SpectrumIdentificationAssumption currentAssumption = currentAssumptionsList.get(searchResultsTable.getSelectedRow());
if (currentAssumption != null) {
currentSpectrumKey = spectrumMatch.getKey();
if (currentAssumption instanceof PeptideAssumption) {
PeptideAssumption currentPeptideAssumption = (PeptideAssumption) currentAssumption;
Peptide peptide = currentPeptideAssumption.getPeptide();
annotationPreferences.setCurrentSettings(currentPeptideAssumption, !currentSpectrumKey.equalsIgnoreCase(spectrumMatch.getKey()),
peptideShakerGUI.getSequenceMatchingPreferences());
ArrayList<IonMatch> annotations = specificAnnotator.getSpectrumAnnotation(annotationPreferences.getIonTypes(),
annotationPreferences.getNeutralLosses(),
annotationPreferences.getValidatedCharges(),
currentPeptideAssumption.getIdentificationCharge().value,
currentSpectrum, peptide,
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(peptide, annotations,
forwardIon, rewindIon, annotationPreferences.getDeNovoCharge(),
annotationPreferences.showForwardIonDeNovoTags(),
annotationPreferences.showRewindIonDeNovoTags());
peptideShakerGUI.updateAnnotationMenus(currentPeptideAssumption.getIdentificationCharge().value, peptide.getModificationMatches());
// update the spectrum title
String modifiedSequence = peptide.getTaggedModifiedSequence(modificationProfile, false, false, true);
((TitledBorder) spectrumPanel.getBorder()).setTitle(
PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING
+ "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;