import | R Documentation |
This function provides a general interface to import different file formats
into MassSpectrum-class
or
MassPeaks-class
objects.
import(
path,
type = "auto",
pattern,
excludePattern = NULL,
removeEmptySpectra = TRUE,
centroided = FALSE,
massRange = c(0, Inf),
minIntensity = 0,
mc.cores = 1L,
verbose = interactive(),
...
)
path |
|
type |
|
pattern |
|
excludePattern |
|
removeEmptySpectra |
|
centroided |
|
massRange |
|
minIntensity |
|
mc.cores |
number of cores to use (default 1; only unix-based platforms
are supported, see
|
verbose |
|
... |
arguments to be passed to specific import functions. |
Specific import functions:
txt | importTxt |
tab | importTab |
csv | importCsv |
fid | importBrukerFlex |
ciphergen | importCiphergenXml |
mzXML | importMzXml |
mzML | importMzMl |
imzML | importImzMl |
analyze | importAnalyze |
cdf | importCdf |
msd | importMsd |
path
: In addition to the above mentioned file types the
following (compressed) archives are supported, too:
zip, tar, tar.gz, tar.bz2, tar.xz. The archives are uncompressed in a
temporary directory. Afterwards the import
function is called (with type="auto"
).
pattern
: Sometimes unusual file extensions are used (e.g.
"*.xml"
for mzXML files). In this case a specific
pattern
could be defined to import files with an unusual file
extension (e.g. pattern="^.*\.xml$"
to read all *.xml
files in a directory; see regexp
for details).
excludePattern
: Sometimes some files should be excluded. E.g.
to ignore additional aquired Bruker LIFT spectra
(MALDI-TOF/TOF; which are not support, yet) you could use
excludePattern="([[:digit:]\.]+)LIFT[\\/]1SRef"
.
a list
of MassSpectrum-class
or
MassPeaks-class
objects (depending on the
centroided
argument).
Sebastian Gibb
https://strimmerlab.github.io/software/maldiquant/
MassSpectrum-class
,
MassPeaks-class
MALDIquantForeign-parallel
library("MALDIquant")
library("MALDIquantForeign")
## get example directory
exampleDirectory <- system.file("exampledata", package="MALDIquantForeign")
## import mzXML files
s <- import(exampleDirectory, type="mzXML")
## import tab delimited file with different file extension (default: *.tab)
s <- import(exampleDirectory, type="tab", pattern="^.*\\.txt")
## import single mzML file
s <- import(file.path(exampleDirectory, "tiny1.mzML1.1.mzML"))
## import gzipped csv file
s <- import(file.path(exampleDirectory, "compressed", "csv1.csv.gz"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.