read_msp: Read MSP Data

read_mspR Documentation

Read MSP Data

Description

This function reads Mass Spectrometry (MS) data in MSP format, processes the data, and extracts MS2 spectra along with metadata (such as m/z and retention time) from the file. It supports handling MSP data from different sources and formats.

Usage

read_msp(file, threads = 3)

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 '3'.

Details

The function parses MSP files to extract both metadata and the MS2 spectra, organizing the data into a structured format for further analysis. It handles both regular MSP formats and those generated by the MetAnalyzer software, which require some additional processing.

Value

A list where each element contains:

info

A list with metadata for each spectrum, typically containing 'mz' (mass-to-charge ratio) and 'rt' (retention time).

spec

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

Author(s)

Xiaotao Shen xiaotao.shen@outlook.com

Examples

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

## End(Not run)


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