progressDialog.setValue(0);
try {
PSParameter psmParameter = new PSParameter();
maxValue = Double.MIN_VALUE;
Identification identification = peptideShakerGUI.getIdentification();
if (psmPrecursorMassErrorJRadioButton.isSelected()) {
// Values for the precursor mass deviation
validatedValues = new ArrayList<Double>();
validatedDoubtfulValues = new ArrayList<Double>();
nonValidatedValues = new ArrayList<Double>();
validatedDecoyValues = new ArrayList<Double>();
nonValidatedDecoyValues = new ArrayList<Double>();
for (String spectrumFileName : identification.getSpectrumFiles()) {
identification.loadSpectrumMatches(spectrumFileName, progressDialog);
identification.loadSpectrumMatchParameters(spectrumFileName, psmParameter, progressDialog);
for (String spectrumKey : identification.getSpectrumIdentification(spectrumFileName)) {
if (progressDialog.isRunCanceled()) {
break;
}
SpectrumMatch spectrumMatch = identification.getSpectrumMatch(spectrumKey);
psmParameter = (PSParameter) identification.getSpectrumMatchParameter(spectrumKey, psmParameter);
if (!psmParameter.isHidden() && spectrumMatch.getBestPeptideAssumption() != null) {
Precursor precursor = peptideShakerGUI.getPrecursor(spectrumKey);
double value = spectrumMatch.getBestPeptideAssumption().getDeltaMass(
precursor.getMz(),
peptideShakerGUI.getSearchParameters().isPrecursorAccuracyTypePpm());
if (value > maxValue) {
maxValue = value;
}
if (!spectrumMatch.getBestPeptideAssumption().getPeptide().isDecoy(peptideShakerGUI.getSequenceMatchingPreferences())) {
if (psmParameter.getMatchValidationLevel().isValidated()) {
if (psmParameter.getMatchValidationLevel() == MatchValidationLevel.confident) {
validatedValues.add(value);
} else {
validatedDoubtfulValues.add(value);
}
} else {
nonValidatedValues.add(value);
}
} else {
if (psmParameter.getMatchValidationLevel().isValidated()) {
validatedDecoyValues.add(value);
} else {
nonValidatedDecoyValues.add(value);
}
}
}
progressDialog.increasePrimaryProgressCounter();
}
}
} else if (psmPrecursorChargeJRadioButton.isSelected()) {
// Values for the precursor charge
validatedValues = new ArrayList<Double>();
validatedDoubtfulValues = new ArrayList<Double>();
nonValidatedValues = new ArrayList<Double>();
validatedDecoyValues = new ArrayList<Double>();
nonValidatedDecoyValues = new ArrayList<Double>();
for (String spectrumFileName : identification.getSpectrumFiles()) {
identification.loadSpectrumMatches(spectrumFileName, progressDialog);
identification.loadSpectrumMatchParameters(spectrumFileName, psmParameter, progressDialog);
for (String spectrumKey : identification.getSpectrumIdentification(spectrumFileName)) {
if (progressDialog.isRunCanceled()) {
break;
}
SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);