9
9
\alias {plot.Spectrum.character }
10
10
\alias {plot }
11
11
12
- \title { Plotting ' Spectrum' object(s ) }
12
+ \title { Plotting ' MSnExp ' and ' Spectrum' object(s ) }
13
13
14
14
\description {
15
15
16
- These method plot mass spectra MZ values against the intensities. Full
17
- spectra (using the \code {full } parameter ) or specific peaks of
16
+ These methods provide the functionality to plot mass spectrometry data
17
+ provided as \code {\linkS4class {MSnExp }},
18
+ \code {\linkS4class {OnDiskMSnExp }} or \code {\linkS4class {Spectrum }}
19
+ objects. Most functions plot mass spectra M / Z values against
20
+ intensities.
21
+
22
+ Full spectra (using the \code {full } parameter ) or specific peaks of
18
23
interest can be plotted using the \code {reporters } parameter. If
19
24
\code {reporters } are specified and \code {full } is set to ' TRUE' , a
20
25
sub - figure of the reporter ions is inlaid inside the full spectrum.
24
29
extract spectra of interest using the \code {[} operator or
25
30
\code {\link {extractPrecSpectra }} methods.
26
31
27
- The methods make use the \code {ggplot2 } system. An object of class
28
- ' ggplot' is returned invisibly.
32
+ Most methods make use the \code {ggplot2 } system in which case an
33
+ object of class ' ggplot' is returned invisibly.
29
34
30
35
If a single \code {" \l inkS4class{Spectrum2}" } and a \code {" character" }
31
36
representing a valid peptide sequence are passed as argument , the
46
51
\item {reporters }{ An object of class
47
52
\code {" \l inkS4class{ReporterIons}" } that defines the peaks to be
48
53
plotted. If not specified , \code {full } must be set to ' TRUE' . }
54
+
49
55
\item {full }{Logical indicating whether full spectrum (respectively
50
56
spectra ) of only reporter ions of interest should be
51
57
plotted. Default is ' FALSE' , in which case \code {reporters } must be
52
58
defined. }
59
+
53
60
\item {centroided. }{Logical indicating if spectrum or spectra are in
54
61
centroided mode , in which case peaks are plotted as histograms ,
55
62
rather than curves. }
63
+
56
64
\item {plot }{Logical specifying whether plot should be printed to
57
65
current device. Default is ' TRUE' . }
66
+
58
67
\item {w1 }{Width of sticks for full centroided spectra. Default is to
59
68
use maximum MZ value divided by 500 . }
69
+
60
70
\item {w2 }{Width of histogram bars for centroided reporter ions
61
71
plots. Default is 0.01 . }
62
72
66
76
67
77
\section {Methods }{
68
78
\describe {
69
- \item {\code {signature(x = " MSnExp" , y = " missing" , reporters =
70
- " ReporterIons" , full = " logical" , plot = " logical" )}}{ Plots
71
- all the spectra in the \code {MSnExp } object vertically. One of
72
- \code {reporters } must be defined or \code {full } set to ' TRUE' . In
73
- case of \code {MSnExp } objects , repoter ions are not inlaid when
74
- \code {full } is ' TRUE' .
79
+ \item {\code {plot(signature(x = " MSnExp" , y = " missing" ),
80
+ type = c(" spectra" , " XIC" ), reporters = " ReporterIons" ,
81
+ full = " logical" , plot = " logical" , ... )}}{
82
+
83
+ For \code {type = " spectra" }: Plots all the spectra in the
84
+ \code {MSnExp } object vertically. One of \code {reporters } must be
85
+ defined or \code {full } set to ' TRUE' . In case of \code {MSnExp }
86
+ objects , repoter ions are not inlaid when \code {full } is ' TRUE' .
87
+
88
+ For \code {type = " XIC" }: Plots a combined plot of retention time
89
+ against m / z values and retention time against largest signal per
90
+ spectrum for each file. Data points are colored by intensity. The
91
+ lower part of the plot represents the location of the individual
92
+ signals in the retention time - m / z space , the upper part the base
93
+ peak chromatogram of the data (i.e. the largest signal for each
94
+ spectrum ). This plot type is restricted to MS level 1 data and is
95
+ most useful for LC - MS data.
96
+ Ideally , the \code {MSnExp } (or \code {OnDiskMSnExp })
97
+ object should be filtered first using the \code {\link {filterRt }}
98
+ and \code {\link {filterMz }} functions to narrow on an ion of
99
+ interest. See examples below. This plot uses base R
100
+ plotting. Additional arguments to the \code {plot } function can be
101
+ passed with \code {... }.
102
+
103
+ Additional arguments for \code {type = " XIC" } are :
104
+ \describe {
105
+ \item {\code {col }}{color for the border of the points. Defaults to
106
+ \code {col = " grey" }. }
107
+
108
+ \item {\code {colramp }}{color function / ramp to be used for the
109
+ intensity - dependent background color of data points. Defaults
110
+ to \code {colramp = topo.colors }. }
111
+
112
+ \item {\code {grid.color }}{color for the grid lines. Defaults to
113
+ \code {grid.color = " lightgrey" }; use \code {grid.color = NA } to
114
+ disable grid lines altogether. }
115
+
116
+ \item {\code {pch }}{point character. Defaults to \code {pch = 21 }}.
117
+
118
+ \item {\code {... }}{additional parameters for the low - level
119
+ \code {plot } function . }
120
+
121
+ }
75
122
}
76
- \item {\code {signature(x = " Spectrum" , y = " missing" , reporters =
123
+ \item {\code {plot( signature(x = " Spectrum" , y = " missing" ) , reporters =
77
124
" ReporterIons" , full = " logical" , centroided. = " logical" , plot =
78
125
" logical" , w1 , w2 )}}{ Displays the MZs against intensities of
79
126
the \code {Spectrum } object as a line plot.
85
132
by default.
86
133
}
87
134
88
- \item {\code {signature(x = " Spectrum2" , y = " character" , orientation
135
+ \item {\code {plot( signature(x = " Spectrum2" , y = " character" ) , orientation
89
136
= " numeric" , add = " logical" , col = " character" , pch , xlab =
90
137
" character" , ylab = " character" , xlim = " numeric" , ylim =
91
138
" numeric" , tolerance = " numeric" , relative = " logical" , type =
111
158
\code {\link {calculateFragments }} to calculate ions produced by
112
159
fragmentation and \code {\link {plot.Spectrum.Spectrum }} to plot and
113
160
compare 2 spectra and their shared peaks.
161
+
162
+ \code {\link {Chromatogram }} for plotting of chromatographic data.
114
163
}
115
164
116
165
\author {
117
- Laurent Gatto < lg390 @ cam.ac.uk > and Sebastian Gibb
166
+ Laurent Gatto < lg390 @ cam.ac.uk > , Johannes Rainer and Sebastian Gibb
118
167
}
119
168
120
169
\examples {
@@ -129,6 +178,18 @@ itraqdata2 <- pickPeaks(itraqdata)
129
178
i <- 14
130
179
s <- as.character(fData(itraqdata2 )[i , " PeptideSequence" ])
131
180
plot(itraqdata2 [[i ]], s , main = s )
181
+
182
+ # # Load profile-mode LC-MS files
183
+ library(msdata )
184
+ od <- readMSData(dir(system.file(" sciex" , package = " msdata" ),
185
+ full.names = TRUE ), mode = " onDisk" )
186
+ # # Restrict the MS data to signal for serine
187
+ serine <- filterMz(filterRt(od , rt = c(175 , 190 )), mz = c(106.04 , 106.06 ))
188
+ plot(serine , type = " XIC" )
189
+
190
+ # # Same plot but using heat.colors, rectangles and no point border
191
+ plot(serine , type = " XIC" , pch = 22 , colramp = heat.colors , col = NA )
192
+
132
193
}
133
194
134
195
\keyword {methods }
0 commit comments