use of com.compomics.util.gui.parameters.identification.advanced.ValidationQCParametersDialog in project peptide-shaker by compomics.
the class PeptideShakerGUI method validationQcMenuItemActionPerformed.
// GEN-LAST:event_configurationFilesSettingsActionPerformed
/**
* Open the ValidationQCPreferencesDialog.
*
* @param evt
*/
private void validationQcMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_validationQcMenuItemActionPerformed
final IdMatchValidationParameters idValidationParameters = getIdentificationParameters().getIdValidationParameters();
final ValidationQcParameters validationQCParameters = idValidationParameters.getValidationQCParameters();
ValidationQCParametersDialog validationQCParametersDialog = new ValidationQCParametersDialog(this, validationQCParameters, getIdentificationParameters().getSearchParameters().getModificationParameters().getAllModifications(), true);
if (!validationQCParametersDialog.isCanceled()) {
ValidationQcParameters newParameters = validationQCParametersDialog.getValidationQCParameters();
if (!newParameters.isSameAs(validationQCParameters)) {
idValidationParameters.setValidationQCParameters(newParameters);
// Update the assumptions QC filters
for (Filter filter : newParameters.getPsmFilters()) {
PsmFilter psmFilter = (PsmFilter) filter;
AssumptionFilter assumptionFilter = psmFilter.getAssumptionFilter();
assumptionFilter.clear();
for (String itemName : psmFilter.getItemsNames()) {
assumptionFilter.setFilterItem(itemName, psmFilter.getComparatorForItem(itemName), psmFilter.getValue(itemName));
}
}
progressDialog = new ProgressDialogX(PeptideShakerGUI.this, Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")), Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")), true);
progressDialog.setTitle("Validating. Please Wait...");
progressDialog.setPrimaryProgressCounterIndeterminate(false);
new Thread(new Runnable() {
public void run() {
try {
progressDialog.setVisible(true);
} catch (IndexOutOfBoundsException e) {
// ignore
}
}
}, "ProgressDialog").start();
new Thread("RecalculateThread") {
@Override
public void run() {
PeptideShakerGUI peptideShakerGUI = PeptideShakerGUI.this;
try {
PSMaps pSMaps = new PSMaps();
pSMaps = (PSMaps) peptideShakerGUI.getIdentification().getUrParam(pSMaps);
MatchesValidator matchesValidator = new MatchesValidator(pSMaps.getPsmMap(), pSMaps.getPeptideMap(), pSMaps.getProteinMap());
matchesValidator.validateIdentifications(peptideShakerGUI.getIdentification(), peptideShakerGUI.getMetrics(), pSMaps.getInputMap(), progressDialog, exceptionHandler, peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getSequenceProvider(), peptideShakerGUI.getProteinDetailsProvider(), peptideShakerGUI.getSpectrumProvider(), peptideShakerGUI.getGeneMaps(), peptideShakerGUI.getIdentificationParameters(), peptideShakerGUI.getProjectType(), peptideShakerGUI.getProcessingParameters());
progressDialog.setPrimaryProgressCounterIndeterminate(true);
ProteinProcessor proteinProcessor = new ProteinProcessor(peptideShakerGUI.getIdentification(), peptideShakerGUI.getIdentificationParameters(), peptideShakerGUI.getIdentificationFeaturesGenerator(), peptideShakerGUI.getSequenceProvider());
proteinProcessor.processProteins(new ModificationLocalizationScorer(), peptideShakerGUI.getMetrics(), modificationFactory, progressDialog, peptideShakerGUI.getExceptionHandler(), peptideShakerGUI.getProcessingParameters());
if (!progressDialog.isRunCanceled()) {
// update the other tabs
peptideShakerGUI.getMetrics().setnValidatedProteins(-1);
peptideShakerGUI.getMetrics().setnConfidentProteins(-1);
peptideShakerGUI.setUpdated(PeptideShakerGUI.OVER_VIEW_TAB_INDEX, false);
peptideShakerGUI.setUpdated(PeptideShakerGUI.PROTEIN_FRACTIONS_TAB_INDEX, false);
peptideShakerGUI.setUpdated(PeptideShakerGUI.STRUCTURES_TAB_INDEX, false);
peptideShakerGUI.setUpdated(PeptideShakerGUI.MODIFICATIONS_TAB_INDEX, false);
peptideShakerGUI.setUpdated(PeptideShakerGUI.QC_PLOTS_TAB_INDEX, false);
peptideShakerGUI.setUpdated(PeptideShakerGUI.SPECTRUM_ID_TAB_INDEX, false);
peptideShakerGUI.setDataSaved(false);
} else {
idValidationParameters.setValidationQCParameters(validationQCParameters);
}
} catch (Exception e) {
peptideShakerGUI.catchException(e);
}
progressDialog.setRunFinished();
PeptideShakerGUI.this.repaintPanels();
}
}.start();
}
}
}
Aggregations