+ "Spectrum & Fragment Ions (" + modifiedSequence
+ " " + currentPeptideAssumption.getIdentificationCharge().toString() + " "
+ Util.roundDouble(currentSpectrum.getPrecursor().getMz(), 2) + " m/z)"
+ PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
} else if (currentAssumption instanceof TagAssumption) {
TagAssumption tagAssumption = (TagAssumption) currentAssumption;
// add the annotations
annotationPreferences.setCurrentSettings(tagAssumption, !currentSpectrumKey.equalsIgnoreCase(spectrumMatch.getKey()),
peptideShakerGUI.getSequenceMatchingPreferences());
TagSpectrumAnnotator spectrumAnnotator = new TagSpectrumAnnotator();
ArrayList<IonMatch> annotations = spectrumAnnotator.getSpectrumAnnotation(annotationPreferences.getIonTypes(),
annotationPreferences.getNeutralLosses(),
annotationPreferences.getValidatedCharges(),
tagAssumption.getIdentificationCharge().value,
currentSpectrum, tagAssumption.getTag(),
currentSpectrum.getIntensityLimit(annotationPreferences.getAnnotationIntensityLimit()),
annotationPreferences.getFragmentIonAccuracy(),
false, annotationPreferences.isHighResolutionAnnotation());
// add the spectrum annotations
tempSpectrumPanel.setAnnotations(SpectrumAnnotator.getSpectrumAnnotation(annotations));
tempSpectrumPanel.showAnnotatedPeaksOnly(!annotationPreferences.showAllPeaks());
tempSpectrumPanel.setYAxisZoomExcludesBackgroundPeaks(annotationPreferences.yAxisZoomExcludesBackgroundPeaks());
// add de novo sequencing
tempSpectrumPanel.addAutomaticDeNovoSequencing(tagAssumption.getTag(), annotations,
forwardIon, rewindIon, annotationPreferences.getDeNovoCharge(),
annotationPreferences.showForwardIonDeNovoTags(),
annotationPreferences.showRewindIonDeNovoTags());
// get the modifications for the tag
ArrayList<ModificationMatch> modificationMatches = new ArrayList<ModificationMatch>();
for (TagComponent tagComponent : tagAssumption.getTag().getContent()) {
if (tagComponent instanceof AminoAcidPattern) {
AminoAcidPattern aminoAcidPattern = (AminoAcidPattern) tagComponent;
for (int site = 1; site <= aminoAcidPattern.length(); site++) {
for (ModificationMatch modificationMatch : aminoAcidPattern.getModificationsAt(site)) {
modificationMatches.add(modificationMatch);
}
}
} else if (tagComponent instanceof AminoAcidSequence) {
AminoAcidSequence aminoAcidSequence = (AminoAcidSequence) tagComponent;
for (int site = 1; site <= aminoAcidSequence.length(); site++) {
for (ModificationMatch modificationMatch : aminoAcidSequence.getModificationsAt(site)) {
modificationMatches.add(modificationMatch);
}
}
} else if (tagComponent instanceof MassGap) {
// Nothing to do here
} else {
throw new UnsupportedOperationException("Annotation not supported for the tag component " + tagComponent.getClass() + ".");
}
}
peptideShakerGUI.updateAnnotationMenus(tagAssumption.getIdentificationCharge().value, modificationMatches);
// update the spectrum title
String modifiedSequence = tagAssumption.getTag().getTaggedModifiedSequence(peptideShakerGUI.getSearchParameters().getModificationProfile(), false, false, true, false);
((TitledBorder) spectrumPanel.getBorder()).setTitle(
PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING
+ "Spectrum & Fragment Ions (" + modifiedSequence
+ " " + tagAssumption.getIdentificationCharge().toString() + " "
+ Util.roundDouble(currentSpectrum.getPrecursor().getMz(), 2) + " m/z)"
+ PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
}
spectrumPanel.repaint();