writer.write(", ");
}
ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
writer.write(mod + " (");
if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
boolean firstSite = true;
for (int site : ptmScoring.getOrderedPtmLocations()) {
if (firstSite) {
firstSite = false;
} else {
writer.write(", ");
}
int ptmConfidence = ptmScoring.getLocalizationConfidence(site);
if (ptmConfidence == PtmScoring.NOT_FOUND) {
writer.write(site + ": Not Scored"); // Well this should not happen
} else if (ptmConfidence == PtmScoring.RANDOM) {
writer.write(site + ": Random");
} else if (ptmConfidence == PtmScoring.DOUBTFUL) {
writer.write(site + ": Doubtfull");
} else if (ptmConfidence == PtmScoring.CONFIDENT) {
writer.write(site + ": Confident");
} else if (ptmConfidence == PtmScoring.VERY_CONFIDENT) {
writer.write(site + ": Very Confident");
}
}
} else {
writer.write("Not Scored");
}
writer.write(")");
}
}
writer.write(SEPARATOR);
if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {
first = true;
for (String mod : modList) {
if (spectrumMatch.getUrParam(ptmScores) != null) {
if (first) {
first = false;
} else {
writer.write(", ");
}
ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
writer.write(mod + " (");
if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
boolean firstSite = true;
ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getProbabilisticSites());
Collections.sort(sites);
for (int site : sites) {
if (firstSite) {
firstSite = false;
} else {
writer.write(", ");
}
writer.write(site + ": " + ptmScoring.getProbabilisticScore(site));
}
} else {
writer.write("Not Scored");
}
writer.write(")");
}
}
}
writer.write(SEPARATOR);
first = true;
for (String mod : modList) {
if (spectrumMatch.getUrParam(ptmScores) != null) {
if (first) {
first = false;
} else {
writer.write(", ");
}
ptmScores = (PSPtmScores) spectrumMatch.getUrParam(new PSPtmScores());
writer.write(mod + " (");
if (ptmScores != null && ptmScores.getPtmScoring(mod) != null) {
PtmScoring ptmScoring = ptmScores.getPtmScoring(mod);
boolean firstSite = true;
ArrayList<Integer> sites = new ArrayList<Integer>(ptmScoring.getDSites());
Collections.sort(sites);
for (int site : sites) {
if (firstSite) {
firstSite = false;
} else {
writer.write(", ");
}
writer.write(site + ": " + ptmScoring.getDeltaScore(site));
}
} else {
writer.write("Not Scored");
}
writer.write(")");