q3ML opens and parses selective reaction monitoring (SRM) .mzML files from Thermo triple quadrupole instruments using direct XML and binary decoding in R. It is aimed at cases where an .mzML file is structurally valid but mzR cannot decode the chromatogram binary arrays produced by newer ProteoWizard conversions.
Install the development version from GitHub:
remotes::install_github("wilsontom/q3ML")openFile() inspects the embedded ProteoWizard version in the .mzML file.
- For files converted with ProteoWizard
<= 3.0.20000,openFile()prints a message and returnsNULL. Those files should be opened withmzR. - For files converted with ProteoWizard
> 3.0.20000,openFile()parses the chromatograms directly and returns the extracted data.
This means q3ML is best used as a targeted fallback for newer SRM .mzML files rather than as a full replacement for mzR.
openFile() returns a list with two elements:
peaks: a list of chromatogram peak tables. Each table containstimeplus one intensity column named from the chromatogram id.header: adata.framedescribing each chromatogram, including polarity and precursor/product isolation window metadata.
library(q3ML)
library(mzR)
mzml_files <- list.files(
system.file("extdata", package = "q3ML"),
full.names = TRUE
)
# Older ProteoWizard output: use mzR
openFile(mzml_files[1])
#> ! Use mzR for files converted with pwiz version <= 3.0.20000
#> NULL
legacy <- mzR::openMSfile(mzml_files[1])
legacy_header <- mzR::chromatogramHeader(legacy)
legacy_peaks <- mzR::chromatograms(legacy)
mzR::close(legacy)
# Newer ProteoWizard output: parse with q3ML
parsed <- openFile(mzml_files[2])
str(parsed, max.level = 1)
#> List of 2
#> $ peaks :List of 107
#> $ header:'data.frame': 107 obs. of 10 variables
# The bundled fixtures represent the same chromatograms exported with
# different ProteoWizard versions, so the parsed outputs match.
identical(parsed$header, legacy_header)
#> [1] TRUE
identical(parsed$peaks, legacy_peaks)
#> [1] TRUEPackage documentation is available at: