View source: R/read_libraries.R
read_lib | R Documentation |
read_lib
offers a way to read mass spectral libraries into R
for further processing.
read_lib(
file,
format = "msp",
type = "MS2",
remove_ri = TRUE,
remove_rt = TRUE
)
file |
Mass spectral library in |
format |
The format of the library, either |
type |
The type of the library, either |
remove_ri |
A logical scalar only used in case of EI mass spectral
library. Should retention index (RI) be removed? |
remove_rt |
A logical scalar only used in case of MS2 mass spectral
library. Should retention time (RT) be removed? |
This is a generic function to read either EI or MS2 mass spectral libraries.
The library can be either in msp
or mgf
form. For this reason,
it is required to set the format and the type of the input library. The
default is MS2
in msp
format. In the case of EI mass spectral
library, an additional Boolean parameter remove_ri
can be set to
remove or keep the retention index (RI). In the case of MS2 mass spectral
library, an additional Boolean parameter remove_rt
can be set to
remove or keep the retention time (RT). This function supports parallel
computing making use of the future.apply. Please see the vignette
for more details.
A list
with each spectral entry as a list element for further
processing.
# The first 2 lines only indicate the location where the example files are
# stored. You might not need them.
EI_file <- system.file("EI.msp", package = "mspcompiler")
MS2_mgf_file <- system.file("MS2.mgf", package = "mspcompiler")
EI <- read_lib(file = EI_file, format = "msp", type = "EI", remove_ri = FALSE)
MS2_mgf <- read_lib(file = MS2_mgf_file, format = "mgf", type = "MS2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.