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();
}
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();
}
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();
}
Aggregations