ReadMspDirectory: Read in MSP Formatted Mass Spectra

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

View source: R/ReadMspDirectory.R

Description

Reads in all .msp files within a directory and makes a single concatenated data frame of m/z values and intensities.

Usage

1
ReadMspDirectory(directory, skip = 2, comment.char = "")

Arguments

directory

character string. The path to the directory containing the .msp files. Can be “./” for the current directory on unix-like systems.

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) text format for centroid spectra. This format is exported by some instrument software.

The spectral files do not need to have the extension .msp. But an attempt will be made to process all files in the directory, regardless of the extension. The presense of other file types may cause errors.

ReadMspDirectory is a wrapper for ReadMspFile.

Value

A data frame with the following column names:

mz

the centroid m/z values.

intensity

the respective intensities.

filename

the corresponding filename (used to identify the spectra within the data frame).

Author(s)

Nathan G. Dodder

See Also

ReadMspFile

Examples

1
2
3
## The package directory msp contains two .msp files 
ReadMspDirectory(paste(system.file(package = "OrgMassSpecR"), 
  "/extdata/msp", sep = ""))

Example output

Loading required package: grid
[1] "Reading file /usr/lib/R/site-library/OrgMassSpecR/extdata/msp/pentaBDE.msp"
[1] "Reading file /usr/lib/R/site-library/OrgMassSpecR/extdata/msp/unknown.msp"
     mz intensity filename
1    50       103 pentaBDE
2    51         8 pentaBDE
3    53        49 pentaBDE
4    60        19 pentaBDE
5    61       223 pentaBDE
6    62       612 pentaBDE
7    63       595 pentaBDE
8    64        33 pentaBDE
9    68        77 pentaBDE
10   72         5 pentaBDE
11   73       160 pentaBDE
12   74       999 pentaBDE
13   75       623 pentaBDE
14   76        35 pentaBDE
15   86        41 pentaBDE
16   87        84 pentaBDE
17   88         9 pentaBDE
18   89         2 pentaBDE
19   90        15 pentaBDE
20   98         9 pentaBDE
21   99         1 pentaBDE
22  100         2 pentaBDE
23  107         9 pentaBDE
24  108        62 pentaBDE
25  109        55 pentaBDE
26  110        31 pentaBDE
27  111        32 pentaBDE
28  112        11 pentaBDE
29  116        17 pentaBDE
30  117        36 pentaBDE
31  118        15 pentaBDE
32  119        29 pentaBDE
33  122        25 pentaBDE
34  123        28 pentaBDE
35  124         1 pentaBDE
36  128        12 pentaBDE
37  130        22 pentaBDE
38  131         5 pentaBDE
39  133         4 pentaBDE
40  134        11 pentaBDE
41  135        13 pentaBDE
42  136        46 pentaBDE
43  137       514 pentaBDE
44  138        60 pentaBDE
45  139         1 pentaBDE
46  140        18 pentaBDE
47  141       201 pentaBDE
48  142        81 pentaBDE
49  143       216 pentaBDE
50  144        59 pentaBDE
51  145         3 pentaBDE
52  147        18 pentaBDE
53  148        44 pentaBDE
54  149        19 pentaBDE
55  150         8 pentaBDE
56  152        21 pentaBDE
57  153       110 pentaBDE
58  154       114 pentaBDE
59  155       111 pentaBDE
60  156        94 pentaBDE
61  157         6 pentaBDE
62  161         4 pentaBDE
63  162        14 pentaBDE
64  163         8 pentaBDE
65  164         3 pentaBDE
66  165        13 pentaBDE
67  166         5 pentaBDE
68  167         1 pentaBDE
69  168         2 pentaBDE
70  169         2 pentaBDE
71  170        36 pentaBDE
72  171        11 pentaBDE
73  172        29 pentaBDE
74  173        15 pentaBDE
75  175         7 pentaBDE
76  177         1 pentaBDE
77  178         1 pentaBDE
78  180         1 pentaBDE
79  181         1 pentaBDE
80  186         2 pentaBDE
81  187         7 pentaBDE
82  188        10 pentaBDE
83  189         8 pentaBDE
84  190         4 pentaBDE
85  191        11 pentaBDE
86  192         4 pentaBDE
87  193        10 pentaBDE
88  194         3 pentaBDE
89  195        26 pentaBDE
90  196         4 pentaBDE
91  197        39 pentaBDE
92  198         3 pentaBDE
93  199        18 pentaBDE
94  200         1 pentaBDE
95  201        73 pentaBDE
96  202       214 pentaBDE
97  203       208 pentaBDE
98  204        74 pentaBDE
99  205         1 pentaBDE
100 214         1 pentaBDE
101 215        34 pentaBDE
102 216        98 pentaBDE
103 217        42 pentaBDE
104 218        96 pentaBDE
105 219        15 pentaBDE
106 220        26 pentaBDE
107 221        59 pentaBDE
108 222        58 pentaBDE
109 223        99 pentaBDE
110 224        37 pentaBDE
111 225        50 pentaBDE
112 226         4 pentaBDE
113 227         1 pentaBDE
114 228         1 pentaBDE
115 231         3 pentaBDE
116 232        29 pentaBDE
117 233        24 pentaBDE
118 234        61 pentaBDE
119 235        42 pentaBDE
120 236        32 pentaBDE
121 237        18 pentaBDE
122 238         1 pentaBDE
123 240         2 pentaBDE
124 241         4 pentaBDE
125 242         9 pentaBDE
126 243        10 pentaBDE
127 244        56 pentaBDE
128 245        12 pentaBDE
129 246        49 pentaBDE
130 247         9 pentaBDE
131 248        16 pentaBDE
132 249        16 pentaBDE
133 250        34 pentaBDE
134 251        24 pentaBDE
135 252        20 pentaBDE
136 253        11 pentaBDE
137 269         1 pentaBDE
138 270         1 pentaBDE
139 271         4 pentaBDE
140 272         2 pentaBDE
141 273         2 pentaBDE
142 274         1 pentaBDE
143 275         1 pentaBDE
144 280         1 pentaBDE
145 281         5 pentaBDE
146 282         9 pentaBDE
147 283         9 pentaBDE
148 284         3 pentaBDE
149 294        11 pentaBDE
150 295       147 pentaBDE
151 296        44 pentaBDE
152 297       249 pentaBDE
153 298        58 pentaBDE
154 299       141 pentaBDE
155 300        34 pentaBDE
156 301        81 pentaBDE
157 302        23 pentaBDE
158 303        81 pentaBDE
159 304        14 pentaBDE
160 305        26 pentaBDE
161 306         1 pentaBDE
162 311         3 pentaBDE
163 312         3 pentaBDE
164 313         8 pentaBDE
165 314         4 pentaBDE
166 315         6 pentaBDE
167 316         3 pentaBDE
168 317         2 pentaBDE
169 322        10 pentaBDE
170 323        24 pentaBDE
171 324        21 pentaBDE
172 325        44 pentaBDE
173 326        23 pentaBDE
174 327        29 pentaBDE
175 328        25 pentaBDE
176 329        24 pentaBDE
177 330        25 pentaBDE
178 331        22 pentaBDE
179 332        12 pentaBDE
180 333         9 pentaBDE
181 334         1 pentaBDE
182 350         1 pentaBDE
183 351         1 pentaBDE
184 352         1 pentaBDE
185 353         1 pentaBDE
186 354         1 pentaBDE
187 372         1 pentaBDE
188 373         2 pentaBDE
189 374         7 pentaBDE
190 375         7 pentaBDE
191 376        10 pentaBDE
192 377         7 pentaBDE
193 378         5 pentaBDE
194 379         2 pentaBDE
195 380         1 pentaBDE
196 400         2 pentaBDE
197 401        18 pentaBDE
198 402       325 pentaBDE
199 403        91 pentaBDE
200 404       743 pentaBDE
201 405       146 pentaBDE
202 406       486 pentaBDE
203 407        84 pentaBDE
204 408        94 pentaBDE
205 409        14 pentaBDE
206 410         2 pentaBDE
207 452         2 pentaBDE
208 453         1 pentaBDE
209 454         3 pentaBDE
210 455         4 pentaBDE
211 456         5 pentaBDE
212 457         6 pentaBDE
213 458         4 pentaBDE
214 459         3 pentaBDE
215 460         1 pentaBDE
216 461         1 pentaBDE
217 466         1 pentaBDE
218 478         1 pentaBDE
219 479         2 pentaBDE
220 481         4 pentaBDE
221 482         4 pentaBDE
222 483         9 pentaBDE
223 484         6 pentaBDE
224 485        10 pentaBDE
225 486         6 pentaBDE
226 487         6 pentaBDE
227 488         5 pentaBDE
228 489         2 pentaBDE
229 490         2 pentaBDE
230 496         1 pentaBDE
231 498         1 pentaBDE
232 500         1 pentaBDE
233 503         1 pentaBDE
234 504         1 pentaBDE
235 505         1 pentaBDE
236 514         1 pentaBDE
237 516         1 pentaBDE
238 519         1 pentaBDE
239 520         1 pentaBDE
240 522         1 pentaBDE
241 523         1 pentaBDE
242 524         1 pentaBDE
243 559        12 pentaBDE
244 560        81 pentaBDE
245 561        70 pentaBDE
246 562       371 pentaBDE
247 563       187 pentaBDE
248 564       633 pentaBDE
249 565       266 pentaBDE
250 566       492 pentaBDE
251 567       178 pentaBDE
252 568       171 pentaBDE
253 569        48 pentaBDE
254 570        23 pentaBDE
255 571         2 pentaBDE
256 572         1 pentaBDE
257 609         1 pentaBDE
258 610         1 pentaBDE
259 611         2 pentaBDE
260 612         2 pentaBDE
261 613         2 pentaBDE
262 614         1 pentaBDE
263  50       309  unknown
264  51       244  unknown
265  52        17  unknown
266  60        11  unknown
267  61        57  unknown
268  62       124  unknown
269  63       300  unknown
270  64        24  unknown
271  65        17  unknown
272  66         2  unknown
273  68        10  unknown
274  69         8  unknown
275  72         9  unknown
276  73       123  unknown
277  74       201  unknown
278  75       474  unknown
279  76        85  unknown
280  77        85  unknown
281  78         8  unknown
282  79        35  unknown
283  80        16  unknown
284  81        46  unknown
285  82        80  unknown
286  83         7  unknown
287  84        24  unknown
288  85        68  unknown
289  86       105  unknown
290  87       151  unknown
291  88        53  unknown
292  89        89  unknown
293  90         9  unknown
294  92         4  unknown
295  93        14  unknown
296  94        26  unknown
297  95         4  unknown
298  96         5  unknown
299  97        31  unknown
300  98        58  unknown
301  99       118  unknown
302 100        51  unknown
303 101        48  unknown
304 102        10  unknown
305 103         2  unknown
306 105        10  unknown
307 106        50  unknown
308 107        43  unknown
309 108        10  unknown
310 109        14  unknown
311 110        41  unknown
312 111        73  unknown
313 112        69  unknown
314 113        91  unknown
315 114        62  unknown
316 115        44  unknown
317 116         3  unknown
318 117        18  unknown
319 118        97  unknown
320 119       326  unknown
321 120       383  unknown
322 121        19  unknown
323 122        19  unknown
324 123        32  unknown
325 124        12  unknown
326 125        46  unknown
327 126        32  unknown
328 127        26  unknown
329 128         4  unknown
330 129         2  unknown
331 131         2  unknown
332 132         3  unknown
333 133         7  unknown
334 134         8  unknown
335 135        11  unknown
336 136        15  unknown
337 137        91  unknown
338 138        96  unknown
339 139        71  unknown
340 140         8  unknown
341 144         3  unknown
342 145         4  unknown
343 146         4  unknown
344 147         7  unknown
345 148         6  unknown
346 149        41  unknown
347 150        29  unknown
348 151        25  unknown
349 152        10  unknown
350 153         1  unknown
351 155         7  unknown
352 156         8  unknown
353 159         2  unknown
354 160         8  unknown
355 161        44  unknown
356 162        92  unknown
357 163       442  unknown
358 164       362  unknown
359 165       858  unknown
360 166       122  unknown
361 167         9  unknown
362 168         1  unknown
363 172         1  unknown
364 173        23  unknown
365 174        11  unknown
366 175        12  unknown
367 176        17  unknown
368 177         3  unknown
369 181         1  unknown
370 182         2  unknown
371 183         4  unknown
372 184         1  unknown
373 185         7  unknown
374 186        11  unknown
375 187        34  unknown
376 188        14  unknown
377 189        13  unknown
378 190         3  unknown
379 195         1  unknown
380 196         1  unknown
381 197        13  unknown
382 198        34  unknown
383 199       998  unknown
384 200       232  unknown
385 201       337  unknown
386 202        78  unknown
387 203         9  unknown
388 207         1  unknown
389 209         1  unknown
390 210         3  unknown
391 211        21  unknown
392 212        10  unknown
393 213        31  unknown
394 214         7  unknown
395 215         6  unknown
396 216         2  unknown
397 222         1  unknown
398 223         3  unknown
399 224         5  unknown
400 225         4  unknown
401 226        12  unknown
402 227         3  unknown
403 233        60  unknown
404 234        29  unknown
405 235       192  unknown
406 236        61  unknown
407 237       186  unknown
408 238        69  unknown
409 239       300  unknown
410 240       123  unknown
411 241       115  unknown
412 242        27  unknown
413 243         4  unknown
414 247         1  unknown
415 249         5  unknown
416 250         1  unknown
417 251         1  unknown
418 252         5  unknown
419 253        11  unknown
420 254         7  unknown
421 255         1  unknown
422 256         1  unknown
423 259         1  unknown
424 260         1  unknown
425 262         1  unknown
426 267         1  unknown
427 269         1  unknown
428 270         2  unknown
429 271         1  unknown
430 272         3  unknown
431 273        13  unknown
432 274         6  unknown
433 275       107  unknown
434 276        78  unknown
435 277        55  unknown
436 278        25  unknown
437 279         6  unknown
438 283         1  unknown
439 284         1  unknown
440 285         2  unknown
441 287         1  unknown
442 289         1  unknown
443 296         1  unknown
444 297         1  unknown
445 309         5  unknown
446 310        14  unknown
447 311       594  unknown
448 312       159  unknown
449 313       397  unknown
450 314        99  unknown
451 315        73  unknown
452 316        15  unknown
453 317         2  unknown
454 322         5  unknown
455 323         1  unknown
456 324         8  unknown
457 325         2  unknown
458 326         6  unknown
459 327         1  unknown
460 328         5  unknown
461 329         1  unknown
462 345        10  unknown
463 346       143  unknown
464 347        47  unknown
465 348       138  unknown
466 349        36  unknown
467 350        40  unknown
468 351         7  unknown
469 358         1  unknown
470 359         2  unknown
471 360         2  unknown
472 361         1  unknown
473 363         1  unknown
474 392         3  unknown
475 393         3  unknown
476 394         7  unknown
477 395         3  unknown
478 396         6  unknown
479 397         2  unknown
480 398         2  unknown
481 400         1  unknown

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