q3ML

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.

Installation

Install the development version from GitHub:

# remotes::install_github("wilsontom/q3ML")
install.packages("q3ML", repos = c('https://wilsontom.r-universe.dev', 'https://cloud.r-project.org'))

When To Use q3ML

openFile() inspects the embedded ProteoWizard version in the .mzML file.

This means q3ML is best used as a targeted fallback for newer SRM .mzML files rather than as a full replacement for mzR.

What openFile() Returns

openFile() returns a list with two elements:

Example

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] TRUE

Documentation

Package documentation is available at:

https://wilsontom.github.io/q3ML/