// additional peptide id parameters
br.write(getCurrentTabSpace() + "<additional>" + System.getProperty("line.separator"));
tabCounter++;
br.write(getCurrentTabSpace() + "<userParam name=\"Spectrum File\" value=\"" + Spectrum.getSpectrumFile(spectrumKey) + "\" />" + System.getProperty("line.separator"));
writeCvTerm(new CvTerm("PSI-MS", "MS:1000796", "Spectrum Title", "" + StringEscapeUtils.escapeHtml4(Spectrum.getSpectrumTitle(spectrumKey))));
br.write(getCurrentTabSpace() + "<userParam name=\"Protein Inference\" value=\"" + peptideProteins + "\" />" + System.getProperty("line.separator"));
br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Confidence\" value=\"" + Util.roundDouble(peptideProbabilities.getPeptideConfidence(), CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
confidenceThreshold = peptideTargetDecoyMap.getTargetDecoyMap(peptideTargetDecoyMap.getCorrectedKey(peptideProbabilities.getSpecificMapKey())).getTargetDecoyResults().getConfidenceLimit();
br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Confidence Threshold\" value=\"" + Util.roundDouble(confidenceThreshold, CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
MatchValidationLevel matchValidationLevel = peptideProbabilities.getMatchValidationLevel();
if (matchValidationLevel == MatchValidationLevel.doubtful && !peptideProbabilities.getReasonDoubtful().equals("")) {
br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Validation\" value=\"" + matchValidationLevel + " (" + StringEscapeUtils.escapeHtml4(peptideProbabilities.getReasonDoubtful()) + ")" + "\" />" + System.getProperty("line.separator"));
} else {
br.write(getCurrentTabSpace() + "<userParam name=\"Peptide Validation\" value=\"" + matchValidationLevel + "\" />" + System.getProperty("line.separator"));
}
br.write(getCurrentTabSpace() + "<userParam name=\"PSM Confidence\" value=\"" + Util.roundDouble(psmProbabilities.getPsmConfidence(), CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
Integer charge = new Integer(psmProbabilities.getSpecificMapKey());
String fileName = Spectrum.getSpectrumFile(spectrumKey);
confidenceThreshold = psmTargetDecoyMap.getTargetDecoyMap(charge, fileName).getTargetDecoyResults().getConfidenceLimit();
br.write(getCurrentTabSpace() + "<userParam name=\"PSM Confidence Threshold\" value=\"" + Util.roundDouble(confidenceThreshold, CONFIDENCE_DECIMALS) + "\" />" + System.getProperty("line.separator"));
matchValidationLevel = psmProbabilities.getMatchValidationLevel();
if (matchValidationLevel == MatchValidationLevel.doubtful && !psmProbabilities.getReasonDoubtful().equals("")) {
br.write(getCurrentTabSpace() + "<userParam name=\"PSM Validation\" value=\"" + matchValidationLevel + " (" + StringEscapeUtils.escapeHtml4(psmProbabilities.getReasonDoubtful()) + ")" + "\" />" + System.getProperty("line.separator"));
} else {
br.write(getCurrentTabSpace() + "<userParam name=\"PSM Validation\" value=\"" + matchValidationLevel + "\" />" + System.getProperty("line.separator"));
}
writeCvTerm(new CvTerm("PSI-MS", "MS:1000041", "Charge State", "" + bestAssumption.getIdentificationCharge().value)); // @TODO: is 2+ etc supported?
//br.write(getCurrentTabSpace() + "<userParam name=\"Identified Charge\" value=\"" + bestAssumption.getIdentificationCharge().value + "\" />" + System.getProperty("line.separator"));
// search engine specific parameters
ArrayList<Integer> searchEngines = new ArrayList<Integer>(eValues.keySet());
Collections.sort(searchEngines);
// add the search engine e-values
ArrayList<Integer> algorithms = new ArrayList<Integer>(eValues.keySet());
Collections.sort(algorithms);
for (int tempAdvocate : algorithms) {
double eValue = eValues.get(tempAdvocate);
if (tempAdvocate == Advocate.msgf.getIndex()) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1002052", "MS-GF:SpecEValue", Double.toString(eValue)));
} else if (tempAdvocate == Advocate.mascot.getIndex()) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1001172", "Mascot:expectation value", Double.toString(eValue)));
} else if (tempAdvocate == Advocate.omssa.getIndex()) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1001328", "OMSSA:evalue", Double.toString(eValue)));
} else if (tempAdvocate == Advocate.xtandem.getIndex()) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1001330", "X!Tandem:expect", Double.toString(eValue)));
} else if (tempAdvocate == Advocate.comet.getIndex()) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1002257", "Comet:expectation value", Double.toString(eValue)));
} else {
br.write(getCurrentTabSpace() + "<userParam name=\"" + Advocate.getAdvocate(tempAdvocate).getName()
+ " e-value\" value=\"" + eValue + "\" />" + System.getProperty("line.separator")); // @TODO: add cv params for the other new advocates
}
// @TODO: add scores for MyriMatch!
// @TODO: add generic e-value for user algorithms?
}
// add the additional search engine scores
if (mascotScore != null) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1001171", "Mascot:score", "" + mascotScore));
}
if (msAmandaScore != null) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1002319", "Amanda:AmandaScore", "" + msAmandaScore));
}
// @TODO: add additional scores for OMSSA and X!Tandem as well
// "MS:1001329", "OMSSA:pvalue"
// "PRIDE:0000182","X|Tandem Z score"
// "MS:1001331", "X!Tandem:hyperscore"
// PTM scoring
if (dScore.length() > 0) {
br.write(getCurrentTabSpace() + "<userParam name=\"PTM D-score\" value=\"" + dScore + "\" />" + System.getProperty("line.separator"));
}
if (ptmScoringPreferences.isProbabilitsticScoreCalculation() && probabilisticScore.length() > 0) {
br.write(getCurrentTabSpace() + "<userParam name=\"PTM "
+ ptmScoringPreferences.getSelectedProbabilisticScore().getName()
+ "\" value=\"" + probabilisticScore + "\" />" + System.getProperty("line.separator"));
}
tabCounter--;
br.write(getCurrentTabSpace() + "</additional>" + System.getProperty("line.separator"));
tabCounter--;
br.write(getCurrentTabSpace() + "</PeptideItem>" + System.getProperty("line.separator"));
}
}
// additional protein id parameters
br.write(getCurrentTabSpace() + "<additional>" + System.getProperty("line.separator"));
tabCounter++;
if (ProteinMatch.isDecoy(proteinKey)) {
br.write(getCurrentTabSpace() + "<userParam name=\"Decoy\" value=\"1\" />" + System.getProperty("line.separator"));
} else {
br.write(getCurrentTabSpace() + "<userParam name=\"Decoy\" value=\"0\" />" + System.getProperty("line.separator"));
}
try {
if (spectrumCountingPreferences.getSelectedMethod() == SpectrumCountingPreferences.SpectralCountingMethod.EMPAI) {
writeCvTerm(new CvTerm("PSI-MS", "MS:1001905", "emPAI value", "" + identificationFeaturesGenerator.getSpectrumCounting(proteinKey)));
} else {
br.write(getCurrentTabSpace() + "<userParam name=\"NSAF+\" value=\""
+ identificationFeaturesGenerator.getSpectrumCounting(proteinKey) + "\" />" + System.getProperty("line.separator"));
}
} catch (Exception e) {