writeMGF2: Writing metadata and a list of spectra to mgf files

View source: R/writeMGF2.R

writeMGF2R Documentation

Writing metadata and a list of spectra to mgf files

Description

The function writes a dataframe of metadata and a list of spectra to a mgf file

Usage

writeMGF2(library, con)

Arguments

library

List that contains 2 elements.

  • sp: List of all extracted spectra. Each spectrum is a data matrix with two columns: m/z and intensity

  • metadata: Data frame containing metadata of extracted scans. PEPMASS and RT are updated based on actually-detected scans. Following five columns are added: FILENAME, MSLEVEL, TIC, MASS_DEV, SCANNUMBER and SCANS

con

Name of the output library, the file extension must be mgf

Examples


data(DRUG_THERMO_LIBRARY)

# Add new metadata "RESOLUTION = HIGH" to all scans:
library2$metadata$RESOLUTION = "HIGH"
# Write into a new mgf file:
writeMGF2(library2,"library_V2_bis.mgf")


daniellyz/MergeION documentation built on Oct. 19, 2022, 1:56 p.m.