// get the fixed ptms
HashMap<Integer, String> fixedPtms = new HashMap<Integer, String>(); // @TODO: note this this only supports one fixed ptm per residue
Identification identification = peptideShakerGUI.getIdentification();
identification.loadPeptideMatches(peptideKeys, null);
DisplayPreferences displayPreferences = peptideShakerGUI.getDisplayPreferences();
for (String peptideKey : peptideKeys) {
boolean modified = false;
for (String ptmName : displayPreferences.getDisplayedPtms()) {
if (Peptide.isModified(peptideKey, ptmName)) {
modified = true;
break;
}
}
if (modified) {
PeptideMatch peptideMatch = identification.getPeptideMatch(peptideKey);
for (ModificationMatch modMatch : peptideMatch.getTheoreticPeptide().getModificationMatches()) {
if (!modMatch.isVariable()) {
String ptmName = modMatch.getTheoreticPtm();
if (displayPreferences.isDisplayedPTM(ptmName)) {
ArrayList<Integer> indexes = sequenceFactory.getProtein(proteinAccession).getPeptideStart(Peptide.getSequence(peptideKey),
peptideShakerGUI.getSequenceMatchingPreferences());
for (Integer index : indexes) {
fixedPtms.put(modMatch.getModificationSite() + index - 2, ptmName);
}
}
}
}
}
}
for (int aa = 0; aa < sequence.length(); aa++) {
String ptmName = fixedPtms.get(aa);
for (String variablePTM : psPtmScores.getPtmsAtRepresentativeSite(aa)) {
if (displayPreferences.isDisplayedPTM(variablePTM)) {
ptmName = variablePTM;
break;
}
}
for (String variablePTM : psPtmScores.getConfidentModificationsAt(aa)) {
if (displayPreferences.isDisplayedPTM(variablePTM)) {
ptmName = variablePTM;
break;
}
}