This function constructs mzML files by writing XML strings directly to a file connection. While this approach is fast, it may be less flexible than DOM-based methods.
Usage
write_mzml(
data,
path_out,
sample_name = NULL,
what = NULL,
instrument_info = NULL,
compress = TRUE,
indexed = TRUE,
force = FALSE,
show_progress = TRUE,
verbose = getOption("verbose")
)
Arguments
- data
List of data.frames or data.tables containing spectral data.
- path_out
The path to write the file.
- sample_name
The name of the file. If a name is not provided, the name will be derived from the
sample_name
attribute.- what
Which streams to write to mzML:
"ms1"
,"ms2"
,"tic"
,"bpc"
, and/or"dad"
.- instrument_info
Instrument info to write to mzML file.
- compress
Logical. Whether to use zlib compression. Defaults to
TRUE
.- indexed
Logical. Whether to write indexed mzML. Defaults to
TRUE
.- force
Logical. Whether to overwrite existing files at
path_out
. Defaults toFALSE
.- show_progress
Logical. Whether to show progress bar. Defaults to
TRUE
.- verbose
Logical. Whether or not to print status messages.
Details
The function supports writing various types of spectral data including MS1, TIC (Total Ion Current), BPC (Base Peak Chromatogram), and DAD (Diode Array Detector) data. Support for MS2 may be added in a future release.
If indexed = TRUE
, the function will generate an indexed mzML file, which
allows faster random access to spectra.