Search in sources :

Example 1 with ProteinInferencePeptideLevelDialog

use of eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog in project peptide-shaker by compomics.

the class ProteinStructurePanel method peptideTableMouseReleased.

// GEN-LAST:event_proteinTableMouseReleased
/**
 * Updates the PDB structure.
 *
 * @param evt
 */
private void peptideTableMouseReleased(java.awt.event.MouseEvent evt) {
    // GEN-FIRST:event_peptideTableMouseReleased
    setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
    if (evt != null) {
        peptideShakerGUI.setSelectedItems(peptideShakerGUI.getSelectedProteinKey(), NO_KEY, null, null);
    }
    int row = peptideTable.getSelectedRow();
    int column = peptideTable.getSelectedColumn();
    if (row != -1) {
        if (pdbMatchesJTable.getSelectedRow() != -1) {
            updatePeptideToPdbMapping();
        }
        // remember the selection
        newItemSelection();
        if (column == peptideTable.getColumn("  ").getModelIndex()) {
            long peptideKey = peptideTableMap.get(getPeptideIndex(row));
            PeptideMatch peptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey);
            PSParameter psParameter = (PSParameter) peptideMatch.getUrParam(PSParameter.dummy);
            if (!psParameter.getStarred()) {
                peptideShakerGUI.getStarHider().starPeptide(peptideKey);
            } else {
                peptideShakerGUI.getStarHider().unStarPeptide(peptideKey);
            }
            peptideShakerGUI.setDataSaved(false);
        }
        // open the protein inference at the petide level dialog
        if (column == peptideTable.getColumn("PI").getModelIndex() && evt != null && evt.getButton() == MouseEvent.BUTTON1) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            int proteinIndex = tableModel.getViewIndex(proteinTable.getSelectedRow());
            long proteinKey = proteinKeys[proteinIndex];
            long peptideKey = peptideTableMap.get(getPeptideIndex(row));
            new ProteinInferencePeptideLevelDialog(peptideShakerGUI, true, peptideKey, proteinKey, peptideShakerGUI.getGeneMaps());
        }
    }
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
}
Also used : PeptideMatch(com.compomics.util.experiment.identification.matches.PeptideMatch) SelfUpdatingTableModel(com.compomics.util.gui.tablemodels.SelfUpdatingTableModel) ProteinInferencePeptideLevelDialog(eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog) XYDataPoint(no.uib.jsparklines.data.XYDataPoint) PSParameter(com.compomics.util.experiment.identification.peptide_shaker.PSParameter)

Example 2 with ProteinInferencePeptideLevelDialog

use of eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog in project peptide-shaker by compomics.

the class ModificationsPanel method relatedPeptidesTableMouseReleased.

// GEN-LAST:event_peptidesTableMouseReleased
/**
 * Update the related peptides PSM table.
 *
 * @param evt
 */
private void relatedPeptidesTableMouseReleased(java.awt.event.MouseEvent evt) {
    // GEN-FIRST:event_relatedPeptidesTableMouseReleased
    final MouseEvent finalEvt = evt;
    progressDialog = new ProgressDialogX(peptideShakerGUI, Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")), Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")), true);
    progressDialog.setPrimaryProgressCounterIndeterminate(true);
    progressDialog.setTitle("Getting Related Peptides. Please Wait...");
    new Thread(new Runnable() {

        public void run() {
            try {
                progressDialog.setVisible(true);
            } catch (IndexOutOfBoundsException e) {
            // ignore
            }
        }
    }).start();
    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            relatedSelected = true;
            if (!progressDialog.isRunCanceled()) {
                updateSelectedPsmTable(progressDialog, false);
            }
            if (!progressDialog.isRunCanceled()) {
                updateRelatedPsmTable(progressDialog, true);
            }
            if (!progressDialog.isRunCanceled()) {
                updateModificationProfiles(progressDialog);
            }
            if (!progressDialog.isRunCanceled()) {
                updateModificationProfilesTable(progressDialog);
            }
            if (!progressDialog.isRunCanceled()) {
                newItemSelection();
            }
            if (finalEvt != null && !progressDialog.isRunCanceled()) {
                int row = relatedPeptidesTable.rowAtPoint(finalEvt.getPoint());
                int column = relatedPeptidesTable.columnAtPoint(finalEvt.getPoint());
                if (row != -1) {
                    relatedPeptidesTable.setRowSelectionInterval(row, row);
                    // open the protein inference at the petide level dialog
                    if (column == relatedPeptidesTable.getColumn("PI").getModelIndex()) {
                        try {
                            long peptideKey = getSelectedPeptide(true);
                            progressDialog.setRunFinished();
                            new ProteinInferencePeptideLevelDialog(peptideShakerGUI, true, peptideKey, null, peptideShakerGUI.getGeneMaps());
                        } catch (Exception e) {
                            peptideShakerGUI.catchException(e);
                        }
                    } else if (column == relatedPeptidesTable.getColumn("Modification").getModelIndex()) {
                        if (relatedPeptidesTable.getValueAt(row, column) != null && ((Integer) relatedPeptidesTable.getValueAt(row, column)).intValue() != -1) {
                            progressDialog.setRunFinished();
                            new ModificationSiteInferenceDialog(peptideShakerGUI, getSelectedPeptide(), modificationFactory.getModification(getSelectedModification()));
                        }
                    } else if (column == peptidesTable.getColumn("   ").getModelIndex()) {
                        try {
                            long peptideKey = getSelectedPeptide(true);
                            PSParameter psParameter = (PSParameter) ((PeptideMatch) peptideShakerGUI.getIdentification().retrieveObject(peptideKey)).getUrParam(PSParameter.dummy);
                            if (!psParameter.getStarred()) {
                                peptideShakerGUI.getStarHider().starPeptide(peptideKey);
                            } else {
                                peptideShakerGUI.getStarHider().unStarPeptide(peptideKey);
                            }
                            peptideShakerGUI.setDataSaved(false);
                        } catch (Exception e) {
                            peptideShakerGUI.catchException(e);
                        }
                    }
                }
            }
            progressDialog.setRunFinished();
        }
    });
}
Also used : ProgressDialogX(com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX) MouseEvent(java.awt.event.MouseEvent) PeptideMatch(com.compomics.util.experiment.identification.matches.PeptideMatch) ModificationSiteInferenceDialog(eu.isas.peptideshaker.gui.ModificationSiteInferenceDialog) ProteinInferencePeptideLevelDialog(eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog) PSParameter(com.compomics.util.experiment.identification.peptide_shaker.PSParameter)

Example 3 with ProteinInferencePeptideLevelDialog

use of eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog in project peptide-shaker by compomics.

the class ModificationsPanel method peptidesTableMouseReleased.

// GEN-LAST:event_formComponentResized
/**
 * Update the related peptides and modified peptide PSMs tables.
 *
 * @param evt
 */
private void peptidesTableMouseReleased(java.awt.event.MouseEvent evt) {
    // GEN-FIRST:event_peptidesTableMouseReleased
    final MouseEvent finalEvt = evt;
    progressDialog = new ProgressDialogX(peptideShakerGUI, Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")), Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")), true);
    progressDialog.setPrimaryProgressCounterIndeterminate(false);
    progressDialog.setTitle("Getting Peptides. Please Wait...");
    new Thread(new Runnable() {

        public void run() {
            try {
                progressDialog.setVisible(true);
            } catch (IndexOutOfBoundsException e) {
            // ignore
            }
        }
    }, "ProgressDialog").start();
    new Thread("DisplayThread") {

        public void run() {
            relatedSelected = false;
            if (!progressDialog.isRunCanceled()) {
                updateRelatedPeptidesTable(progressDialog);
            }
            if (!progressDialog.isRunCanceled()) {
                updateSelectedPsmTable(progressDialog, true);
            }
            if (!progressDialog.isRunCanceled()) {
                updateRelatedPsmTable(progressDialog, false);
            }
            if (!progressDialog.isRunCanceled()) {
                updateModificationProfiles(progressDialog);
            }
            if (!progressDialog.isRunCanceled()) {
                updateModificationProfilesTable(progressDialog);
            }
            if (!progressDialog.isRunCanceled()) {
                newItemSelection();
            }
            if (finalEvt != null) {
                int row = peptidesTable.rowAtPoint(finalEvt.getPoint());
                int column = peptidesTable.columnAtPoint(finalEvt.getPoint());
                if (row != -1 && !progressDialog.isRunCanceled()) {
                    peptidesTable.setRowSelectionInterval(row, row);
                    // open the protein inference at the petide level dialog
                    if (column == peptidesTable.getColumn("PI").getModelIndex()) {
                        progressDialog.setRunFinished();
                        try {
                            long peptideKey = getSelectedPeptide(false);
                            new ProteinInferencePeptideLevelDialog(peptideShakerGUI, true, peptideKey, null, peptideShakerGUI.getGeneMaps());
                        } catch (Exception e) {
                            peptideShakerGUI.catchException(e);
                        }
                    } else if (column == peptidesTable.getColumn("Modification").getModelIndex()) {
                        if (peptidesTable.getValueAt(row, column) != null && ((Integer) peptidesTable.getValueAt(row, column)).intValue() != -1) {
                            progressDialog.setRunFinished();
                            new ModificationSiteInferenceDialog(peptideShakerGUI, getSelectedPeptide(), modificationFactory.getModification(getSelectedModification()));
                        }
                    } else if (column == peptidesTable.getColumn("   ").getModelIndex()) {
                        try {
                            long peptideKey = getSelectedPeptide(false);
                            PSParameter psParameter = (PSParameter) ((PeptideMatch) peptideShakerGUI.getIdentification().retrieveObject(peptideKey)).getUrParam(PSParameter.dummy);
                            if (!psParameter.getStarred()) {
                                peptideShakerGUI.getStarHider().starPeptide(peptideKey);
                            } else {
                                peptideShakerGUI.getStarHider().unStarPeptide(peptideKey);
                            }
                            peptideShakerGUI.setDataSaved(false);
                        } catch (Exception e) {
                            peptideShakerGUI.catchException(e);
                        }
                    }
                }
            }
            progressDialog.setRunFinished();
        }
    }.start();
}
Also used : ProgressDialogX(com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX) MouseEvent(java.awt.event.MouseEvent) PeptideMatch(com.compomics.util.experiment.identification.matches.PeptideMatch) ModificationSiteInferenceDialog(eu.isas.peptideshaker.gui.ModificationSiteInferenceDialog) ProteinInferencePeptideLevelDialog(eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog) PSParameter(com.compomics.util.experiment.identification.peptide_shaker.PSParameter)

Example 4 with ProteinInferencePeptideLevelDialog

use of eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog in project peptide-shaker by compomics.

the class OverviewPanel method peptideTableMouseReleased.

// GEN-LAST:event_proteinTableMouseReleased
/**
 * Updates the tables according to the currently selected peptide.
 *
 * @param evt
 */
private void peptideTableMouseReleased(java.awt.event.MouseEvent evt) {
    // GEN-FIRST:event_peptideTableMouseReleased
    int row = peptideTable.getSelectedRow();
    final int column = peptideTable.getSelectedColumn();
    if (row != -1) {
        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
        int peptideIndex = tableModel.getViewIndex(row);
        long peptideKey = peptideKeys[peptideIndex];
        peptideShakerGUI.setSelectedItems(peptideShakerGUI.getSelectedProteinKey(), peptideKey, null, null);
        // update the psm selection
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                updatePsmSelection(row, false);
            }
        });
        // new peptide, reset spectrum boundaries
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                if (psmTable.getSelectedRow() != -1) {
                    SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                    updateSpectrum(tableModel.getViewIndex(psmTable.getSelectedRow()), true);
                    peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")));
                }
            }
        });
        // star/unstar a peptide
        if (column == peptideTable.getColumn("  ").getModelIndex()) {
            PeptideMatch peptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey);
            PSParameter psParameter = (PSParameter) peptideMatch.getUrParam(PSParameter.dummy);
            if (!psParameter.getStarred()) {
                peptideShakerGUI.getStarHider().starPeptide(peptideKey);
            } else {
                peptideShakerGUI.getStarHider().unStarPeptide(peptideKey);
            }
            peptideShakerGUI.setDataSaved(false);
        }
        // open the protein inference at the petide level dialog
        if (column == peptideTable.getColumn("PI").getModelIndex() && evt != null && evt.getButton() == MouseEvent.BUTTON1) {
            tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            long proteinKey = proteinKeys[tableModel.getViewIndex(proteinTable.getSelectedRow())];
            new ProteinInferencePeptideLevelDialog(peptideShakerGUI, true, peptideKey, proteinKey, peptideShakerGUI.getGeneMaps());
        }
        // open the match validation level dialog
        if (column == peptideTable.getColumn("").getModelIndex() && evt != null && evt.getButton() == MouseEvent.BUTTON1) {
            Identification identification = peptideShakerGUI.getIdentification();
            PSMaps pSMaps = new PSMaps();
            pSMaps = (PSMaps) identification.getUrParam(pSMaps);
            MatchValidationDialog matchValidationDialog = new MatchValidationDialog(peptideShakerGUI, identification, pSMaps.getPeptideMap(), peptideKey, peptideShakerGUI.getIdentificationParameters(), peptideShakerGUI.getProjectDetails().getFastaFile(), MatchType.PEPTIDE);
            if (matchValidationDialog.isValidationChanged()) {
                updateProteinPanelTitle();
                updatePeptidePanelTitle();
            }
        }
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                try {
                    updateSelection(true);
                } catch (Exception e) {
                    peptideShakerGUI.catchException(e);
                }
            }
        });
    }
}
Also used : PSMaps(eu.isas.peptideshaker.scoring.PSMaps) SelfUpdatingTableModel(com.compomics.util.gui.tablemodels.SelfUpdatingTableModel) Identification(com.compomics.util.experiment.identification.Identification) ProteinInferencePeptideLevelDialog(eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog) MatchValidationDialog(eu.isas.peptideshaker.gui.MatchValidationDialog) PSParameter(com.compomics.util.experiment.identification.peptide_shaker.PSParameter) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

PSParameter (com.compomics.util.experiment.identification.peptide_shaker.PSParameter)4 ProteinInferencePeptideLevelDialog (eu.isas.peptideshaker.gui.protein_inference.ProteinInferencePeptideLevelDialog)4 PeptideMatch (com.compomics.util.experiment.identification.matches.PeptideMatch)3 SelfUpdatingTableModel (com.compomics.util.gui.tablemodels.SelfUpdatingTableModel)2 ProgressDialogX (com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX)2 ModificationSiteInferenceDialog (eu.isas.peptideshaker.gui.ModificationSiteInferenceDialog)2 MouseEvent (java.awt.event.MouseEvent)2 Identification (com.compomics.util.experiment.identification.Identification)1 MatchValidationDialog (eu.isas.peptideshaker.gui.MatchValidationDialog)1 PSMaps (eu.isas.peptideshaker.scoring.PSMaps)1 FileNotFoundException (java.io.FileNotFoundException)1 XYDataPoint (no.uib.jsparklines.data.XYDataPoint)1