read_msp_database: Read MSP Database

read_msp_databaseR Documentation

Read MSP Database

Description

This function reads Mass Spectrometry (MS) data in MSP format from a database, processes the data, and extracts MS2 spectra along with metadata (such as m/z, retention time, and other possible descriptors) from the file. The function supports handling various MSP formats, including those generated by specific software like MetAnalyzer.

Usage

read_msp_database(file, threads = 4)

Arguments

file

A character string specifying the file path to the MSP file.

threads

Numeric, the number of threads to use for parallel processing (not yet implemented). Defaults to '4'.

Details

The function parses MSP files, extracting both metadata and MS2 spectra, organizing the data into a structured format for further analysis. It can handle MSP data from various sources, including those with custom formats like MetAnalyzer.

Value

A list where each element contains:

info

A named list containing metadata such as 'mz' (mass-to-charge ratio), 'rt' (retention time), and other descriptors for each spectrum.

spec

A data frame containing the 'mz' and 'intensity' values of the MS2 spectrum.

Author(s)

Xiaotao Shen xiaotao.shen@outlook.com

Examples

## Not run: 
# Read MSP data from a database
msp_data <- read_msp_database(file = "path/to/database.msp")

## End(Not run)


tidymass/metid documentation built on Oct. 8, 2024, 10:32 p.m.