PeakAnnotation: Peak annotations

Description Arguments Examples

Description

This class defines how peaks in an MS spectrum are annotated. In its current preliminary implementation, if defines lists of peaks and and annotations, both of which must have the same length. Each element of peaks is annotated by the corresponding element of annotations. Elements of peaks can contain a single numeric corresponding to the m/z of a peak in a centroided spectrum, of a vector of m/z values when a set of peaks (for instance in case of profile mode data) are annotated by an annotation.

Currently, there are no constrains on either peaks and annotations elements. The latters can be either descriptive characters, as in the examples below, or could be encoded as dataframes. This is likely to change in the future.

Objects are created with the PeakAnnotation(peaks, annotations) and PeakAnnotations(...) contructors.

Arguments

peaks

A list of peak m/z values to be annotated.

annotations

A list of peak annotations.

...

Objects of class PeaksAnnotation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
pa1 <- PeakAnnotation(peaks = list(123.3,
                                   c(234.1, 234.12, 234.15)),
                      annotations = list("b2", "y3"))
pa1

pa2 <- PeakAnnotation(peaks = list(c(345.3, 345.32, 345.35, 345.39, 345.4),
                                   657.01,
                                   1231.182),
                      annotations = list("a5", "z3", "y7"))
pa2

pas <- PeakAnnotations(pa1, pa2)
pas

dfr <- DataFrame(x = 1:2,
                 y = LETTERS[1:2],
                 annot = pas)
dfr

lgatto/Spectrum documentation built on May 8, 2019, 9:07 a.m.