Exports the MS2 data contained in a mass_dataset object to files. The files can be in MGF or MSP format.

export_ms2_data(object, file_type = c("mgf", "msp"), path = ".")

Arguments

object

A mass_dataset object containing MS2 data to be exported.

file_type

The type of file to export the MS2 data to. Options are "mgf" or "msp". Default is "mgf".

path

The directory where the exported MS2 data files will be saved. Default is the current directory.

Value

No return value. The function writes MS2 data files to disk. Returns NULL and a warning if no MS2 data is present in the object.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

if (FALSE) { # \dontrun{
# Assuming 'data' is a mass_dataset object with MS2 data
export_ms2_data(data, file_type = "mgf", path = "output/")
} # }