View source: R/functions-mgf.R
readMgf | R Documentation |
The readMgf()
function imports the data from a file in MGF format reading
all specified fields and returning the data as a S4Vectors::DataFrame()
.
For very large MGF files the readMgfSplit()
function might be used
instead. In contrast to the readMgf()
functions, readMgfSplit()
reads
only nlines
lines from an MGF file at once reducing thus the memory
demand (at the cost of a lower performance, compared to readMgf()
).
readMgf(
f,
msLevel = 2L,
mapping = spectraVariableMapping(MsBackendMgf()),
annotated = FALSE,
...,
BPPARAM = SerialParam()
)
readMgfSplit(
f,
msLevel = 2L,
mapping = spectraVariableMapping(MsBackendMgf()),
nlines = 1e+05,
BPPARAM = SerialParam(),
...
)
f |
|
msLevel |
|
mapping |
named |
annotated |
For |
... |
Additional parameters, currently ignored. |
BPPARAM |
parallel processing setup that should be used. Only the parsing of the imported MGF file is performed in parallel. |
nlines |
for |
A DataFrame
with each row containing the data from one spectrum
in the MGF file. m/z and intensity values are available in columns "mz"
and "intensity"
in a list representation. For readMgf()
with
annotated = TRUE
also all peaks annotation columns (named "V1", etc) are provided in a list representation, with the lengths of elements matching those of
"mz"or
"intensity"'.
Laurent Gatto, Johannes Rainer, Sebastian Gibb, Corey Broeckling
fls <- dir(system.file("extdata", package = "MsBackendMgf"),
full.names = TRUE, pattern = "mgf$")[1L]
readMgf(fls)
## Annotated MGF
fl <- system.file("extdata", "xfiora.mgf", package = "MsBackendMgf")
res <- readMgf(fl, annotated = TRUE)
colnames(res)
res$V1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.