SIB

Recipe 1.2 - Creating PeakAnnotation

Problem

You want to make a new instance of PeakAnnotation.

Solution

A PeakAnnotation is associated to PeakList peaks. It gives meta information about a given peak. We have actually two kind of implementations: PepFragAnnotation gives identification information about the associated theoretical fragment


Peptide peptideFragment = Peptide.parse("CER");
int charge = 2;

new PepFragAnnotation(IonType.b, charge, peptideFragment);

LibraryPeakAnnotation stores statistical information about the consensus peaks


int mergedPeakCount = 10;
double mzStd = 0.05;
double intensityStd = 0.12;

new PepLibPeakAnnotation(mergedPeakCount, mzStd, intensityStd);

Then PeakAnnotations is added to PeakList at specific peak index


PeakList<PepFragAnnotation> peaklist = new FloatPeakList<PepFragAnnotation>();

peaklist.add(200, 100, Arrays.asList(annotation));

Discussion

See also

For more information about peaks, see Recipe 1.1