ReadMspFile: Read in a MSP Formatted Mass Spectrum

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ReadMspFile.R

Description

Reads in a .msp file and makes a data frame of m/z values and intensities.

Usage

1
ReadMspFile(file, skip = 2, comment.char = "")

Arguments

file

character string. The .msp filename. Include the path to the filename if necessary.

skip

integer. The number of lines at the top of the input file to skip before reading. Passed internally to read.table.

comment.char

a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether. Passed internally to read.table.

Details

MSP is a National Institute of Standards and Technology (NIST) ASCII format for centroid spectra. This format is exported by some instrument software.

The spectral file does not need to have the extension .msp.

Value

A data frame with the following column names:

mz

the centroid m/z values.

intensity

the respective intensities.

Author(s)

Nathan G. Dodder

See Also

ReadMspDirectory

Examples

1
ReadMspFile(paste(system.file(package = "OrgMassSpecR"), "/extdata/msp/pentaBDE.msp", sep = ""))

Example output

Loading required package: grid
     mz intensity
1    50       103
2    51         8
3    53        49
4    60        19
5    61       223
6    62       612
7    63       595
8    64        33
9    68        77
10   72         5
11   73       160
12   74       999
13   75       623
14   76        35
15   86        41
16   87        84
17   88         9
18   89         2
19   90        15
20   98         9
21   99         1
22  100         2
23  107         9
24  108        62
25  109        55
26  110        31
27  111        32
28  112        11
29  116        17
30  117        36
31  118        15
32  119        29
33  122        25
34  123        28
35  124         1
36  128        12
37  130        22
38  131         5
39  133         4
40  134        11
41  135        13
42  136        46
43  137       514
44  138        60
45  139         1
46  140        18
47  141       201
48  142        81
49  143       216
50  144        59
51  145         3
52  147        18
53  148        44
54  149        19
55  150         8
56  152        21
57  153       110
58  154       114
59  155       111
60  156        94
61  157         6
62  161         4
63  162        14
64  163         8
65  164         3
66  165        13
67  166         5
68  167         1
69  168         2
70  169         2
71  170        36
72  171        11
73  172        29
74  173        15
75  175         7
76  177         1
77  178         1
78  180         1
79  181         1
80  186         2
81  187         7
82  188        10
83  189         8
84  190         4
85  191        11
86  192         4
87  193        10
88  194         3
89  195        26
90  196         4
91  197        39
92  198         3
93  199        18
94  200         1
95  201        73
96  202       214
97  203       208
98  204        74
99  205         1
100 214         1
101 215        34
102 216        98
103 217        42
104 218        96
105 219        15
106 220        26
107 221        59
108 222        58
109 223        99
110 224        37
111 225        50
112 226         4
113 227         1
114 228         1
115 231         3
116 232        29
117 233        24
118 234        61
119 235        42
120 236        32
121 237        18
122 238         1
123 240         2
124 241         4
125 242         9
126 243        10
127 244        56
128 245        12
129 246        49
130 247         9
131 248        16
132 249        16
133 250        34
134 251        24
135 252        20
136 253        11
137 269         1
138 270         1
139 271         4
140 272         2
141 273         2
142 274         1
143 275         1
144 280         1
145 281         5
146 282         9
147 283         9
148 284         3
149 294        11
150 295       147
151 296        44
152 297       249
153 298        58
154 299       141
155 300        34
156 301        81
157 302        23
158 303        81
159 304        14
160 305        26
161 306         1
162 311         3
163 312         3
164 313         8
165 314         4
166 315         6
167 316         3
168 317         2
169 322        10
170 323        24
171 324        21
172 325        44
173 326        23
174 327        29
175 328        25
176 329        24
177 330        25
178 331        22
179 332        12
180 333         9
181 334         1
182 350         1
183 351         1
184 352         1
185 353         1
186 354         1
187 372         1
188 373         2
189 374         7
190 375         7
191 376        10
192 377         7
193 378         5
194 379         2
195 380         1
196 400         2
197 401        18
198 402       325
199 403        91
200 404       743
201 405       146
202 406       486
203 407        84
204 408        94
205 409        14
206 410         2
207 452         2
208 453         1
209 454         3
210 455         4
211 456         5
212 457         6
213 458         4
214 459         3
215 460         1
216 461         1
217 466         1
218 478         1
219 479         2
220 481         4
221 482         4
222 483         9
223 484         6
224 485        10
225 486         6
226 487         6
227 488         5
228 489         2
229 490         2
230 496         1
231 498         1
232 500         1
233 503         1
234 504         1
235 505         1
236 514         1
237 516         1
238 519         1
239 520         1
240 522         1
241 523         1
242 524         1
243 559        12
244 560        81
245 561        70
246 562       371
247 563       187
248 564       633
249 565       266
250 566       492
251 567       178
252 568       171
253 569        48
254 570        23
255 571         2
256 572         1
257 609         1
258 610         1
259 611         2
260 612         2
261 613         2
262 614         1

OrgMassSpecR documentation built on May 2, 2019, 6:48 p.m.