Search in sources :

Example 6 with ProteinTableModel

use of eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel in project peptide-shaker by compomics.

the class OverviewPanel method displayResults.

/**
 * Displays the results in the tables.
 */
public void displayResults() {
    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("Loading Overview. Please Wait...");
    new Thread(new Runnable() {

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

        @Override
        public void run() {
            try {
                peptideShakerGUI.getIdentificationFeaturesGenerator().setProteinKeys(peptideShakerGUI.getMetrics().getProteinKeys());
                proteinKeys = peptideShakerGUI.getIdentificationFeaturesGenerator().getProcessedProteinKeys(progressDialog, peptideShakerGUI.getFilterParameters());
                progressDialog.setPrimaryProgressCounterIndeterminate(true);
                progressDialog.setTitle("Preparing Overview. Please Wait...");
                // change the peptide shaker icon to a "waiting version" // @TODO: not really sure why we need to set this again here, but seems to be needed
                peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")));
                peptideShakerGUI.resetSelectedItems();
                setTableProperties();
                // update the table model
                if (proteinTable.getModel() instanceof ProteinTableModel && ((ProteinTableModel) proteinTable.getModel()).isInstantiated()) {
                    ((ProteinTableModel) proteinTable.getModel()).updateDataModel(peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getProteinDetailsProvider(), peptideShakerGUI.getSequenceProvider(), peptideShakerGUI.getGeneMaps(), peptideShakerGUI.getDisplayFeaturesGenerator(), proteinKeys);
                } else {
                    ProteinTableModel proteinTableModel = new ProteinTableModel(peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getProteinDetailsProvider(), peptideShakerGUI.getSequenceProvider(), peptideShakerGUI.getGeneMaps(), peptideShakerGUI.getDisplayFeaturesGenerator(), peptideShakerGUI.getExceptionHandler(), proteinKeys);
                    proteinTable.setModel(proteinTableModel);
                }
                setTableProperties();
                showSparkLines(peptideShakerGUI.showSparklines());
                ((DefaultTableModel) proteinTable.getModel()).fireTableDataChanged();
                // update spectrum counting column header tooltip
                if (peptideShakerGUI.getSpectrumCountingParameters().getSelectedMethod() == SpectrumCountingMethod.NSAF) {
                    proteinTableToolTips.set(proteinTable.getColumn("MS2 Quant.").getModelIndex(), "Protein MS2 Quantification - NSAF");
                } else if (peptideShakerGUI.getSpectrumCountingParameters().getSelectedMethod() == SpectrumCountingMethod.EMPAI) {
                    proteinTableToolTips.set(proteinTable.getColumn("MS2 Quant.").getModelIndex(), "Protein MS2 Quantification - emPAI");
                } else {
                    proteinTableToolTips.set(proteinTable.getColumn("MS2 Quant.").getModelIndex(), "Protein MS2 Quantification");
                }
                if (peptideShakerGUI.getDisplayParameters().showScores()) {
                    proteinTableToolTips.set(proteinTable.getColumnCount() - 2, "Protein Score");
                } else {
                    proteinTableToolTips.set(proteinTable.getColumnCount() - 2, "Protein Confidence");
                }
                updateProteinPanelTitle();
                updateProteinTableCellRenderers();
                // update the slider tooltips
                SearchParameters searchParameters = peptideShakerGUI.getIdentificationParameters().getSearchParameters();
                double accuracy = (accuracySlider.getValue() / 100.0) * searchParameters.getFragmentIonAccuracy();
                accuracySlider.setToolTipText("Annotation Accuracy: " + Util.roundDouble(accuracy, 2) + " " + searchParameters.getFragmentAccuracyType());
                intensitySlider.setToolTipText("Annotation Level: " + intensitySlider.getValue() + "%");
                // enable the contextual export options
                exportProteinsJButton.setEnabled(true);
                exportPeptidesJButton.setEnabled(true);
                exportPsmsJButton.setEnabled(true);
                exportSpectrumJButton.setEnabled(true);
                exportSequenceCoverageContextJButton.setEnabled(true);
                peptideShakerGUI.setUpdated(PeptideShakerGUI.OVER_VIEW_TAB_INDEX, true);
                peptideShakerGUI.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
                progressDialog.setRunFinished();
                new Thread(new Runnable() {

                    public void run() {
                        try {
                            peptideShakerGUI.checkNewsFeed();
                            peptideShakerGUI.showNotesNotification();
                            peptideShakerGUI.showTipsNotification();
                            proteinTable.requestFocus();
                            updateSelection(true);
                        } catch (Exception e) {
                            peptideShakerGUI.catchException(e);
                        }
                    }
                }, "UpdateSelectionThread").start();
            } catch (Exception e) {
                peptideShakerGUI.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
                peptideShakerGUI.catchException(e);
                progressDialog.setRunFinished();
            }
        }
    }.start();
}
Also used : ProgressDialogX(com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX) SearchParameters(com.compomics.util.parameters.identification.search.SearchParameters) ProteinTableModel(eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel) FileNotFoundException(java.io.FileNotFoundException) java.awt(java.awt)

Example 7 with ProteinTableModel

use of eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel in project peptide-shaker by compomics.

the class ProteinFractionsPanel method displayResults.

/**
 * Display the results.
 */
public void displayResults() {
    if (!fractionOrderSet) {
        fractionOrderSet = true;
        new FractionDetailsDialog(peptideShakerGUI, true);
    }
    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("Loading Fractions. Please Wait...");
    new Thread(new Runnable() {

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

        @Override
        public void run() {
            proteinKeys = peptideShakerGUI.getIdentificationFeaturesGenerator().getProcessedProteinKeys(progressDialog, peptideShakerGUI.getFilterParameters());
            // update the table model
            if (proteinTable.getModel() instanceof ProteinTableModel && ((ProteinTableModel) proteinTable.getModel()).isInstantiated()) {
                ((ProteinTableModel) proteinTable.getModel()).updateDataModel(peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getProteinDetailsProvider(), peptideShakerGUI.getSequenceProvider(), peptideShakerGUI.getGeneMaps(), peptideShakerGUI.getDisplayFeaturesGenerator(), proteinKeys);
            } else {
                ProteinTableModel proteinTableModel = new ProteinTableModel(peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getProteinDetailsProvider(), peptideShakerGUI.getSequenceProvider(), peptideShakerGUI.getGeneMaps(), peptideShakerGUI.getDisplayFeaturesGenerator(), peptideShakerGUI.getExceptionHandler(), proteinKeys);
                proteinTable.setModel(proteinTableModel);
            }
            setTableProperties();
            showSparkLines(peptideShakerGUI.showSparklines());
            ((DefaultTableModel) proteinTable.getModel()).fireTableDataChanged();
            updateSelection();
            proteinTable.requestFocus();
            setUpTableHeaderToolTips();
            updateProteinTableCellRenderers();
            peptideShakerGUI.setUpdated(PeptideShakerGUI.PROTEIN_FRACTIONS_TAB_INDEX, true);
            String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Proteins (";
            int nValidated = peptideShakerGUI.getIdentificationFeaturesGenerator().getNValidatedProteins();
            int nConfident = peptideShakerGUI.getIdentificationFeaturesGenerator().getNConfidentProteins();
            int nProteins = proteinTable.getRowCount();
            if (nConfident > 0) {
                title += nValidated + "/" + nProteins + " - " + nConfident + " confident, " + (nValidated - nConfident) + " doubtful";
            } else {
                title += nValidated + "/" + nProteins;
            }
            title += ")" + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING;
            // update the border titles
            ((TitledBorder) proteinPanel.getBorder()).setTitle(title);
            proteinPanel.repaint();
            plotsTabbedPane.setSelectedIndex(5);
            // enable the contextual export options
            exportProteinsJButton.setEnabled(true);
            exportPeptidesJButton.setEnabled(true);
            progressDialog.setRunFinished();
        }
    }.start();
}
Also used : ProgressDialogX(com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX) FractionDetailsDialog(eu.isas.peptideshaker.gui.FractionDetailsDialog) ProteinTableModel(eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel)

Example 8 with ProteinTableModel

use of eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel in project peptide-shaker by compomics.

the class ProteinFractionsPanel method clearData.

/**
 * Clear all the data.
 */
public void clearData() {
    proteinKeys = new long[0];
    peptideKeys = new long[0];
    ProteinTableModel proteinTableModel = (ProteinTableModel) proteinTable.getModel();
    proteinTableModel.reset();
    proteinTableModel.fireTableDataChanged();
    ((TitledBorder) proteinPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Proteins" + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
    proteinPanel.repaint();
    ((TitledBorder) plotsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptides" + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
    plotsPanel.repaint();
}
Also used : ProteinTableModel(eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel) TitledBorder(javax.swing.border.TitledBorder)

Aggregations

ProteinTableModel (eu.isas.peptideshaker.gui.tablemodels.ProteinTableModel)8 ProgressDialogX (com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX)4 PeptideTableModel (eu.isas.peptideshaker.gui.tablemodels.PeptideTableModel)3 PsmTableModel (eu.isas.peptideshaker.gui.tablemodels.PsmTableModel)3 java.awt (java.awt)3 KeyEvent (java.awt.event.KeyEvent)3 MouseAdapter (java.awt.event.MouseAdapter)3 MouseEvent (java.awt.event.MouseEvent)3 FileNotFoundException (java.io.FileNotFoundException)3 javax.swing (javax.swing)3 TitledBorder (javax.swing.border.TitledBorder)3 JTableHeader (javax.swing.table.JTableHeader)3 SearchParameters (com.compomics.util.parameters.identification.search.SearchParameters)2 ArrayUtil (com.compomics.util.ArrayUtil)1 Util (com.compomics.util.Util)1 BareBonesBrowserLaunch (com.compomics.util.examples.BareBonesBrowserLaunch)1 Charge (com.compomics.util.experiment.biology.ions.Charge)1 Peptide (com.compomics.util.experiment.biology.proteins.Peptide)1 Variant (com.compomics.util.experiment.biology.variants.Variant)1 Identification (com.compomics.util.experiment.identification.Identification)1