Skip to content

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

msdxr

msdxr provides tools to read and parse GC-MS data stored in the proprietary MSDX binary format used by Chromatec instruments.

The package implements a custom parser, developed via empirical (black-box) reconstruction of the file format, that allows users to:

  • Import GC-MS data into R along with basic instrument metadata
  • Access individual mass spectra
  • Extract total ion (TIC) and extracted ion chromatograms (XIC)

This package is not affiliated with, endorsed by, or associated with Chromatec.

Installation

# Install 'msdxr' from GitHub:
remotes::install_github("andreysamokhin/msdxr")

Documentation and examples

The package reference manual and vignette are available both locally (in the doc/ directory) and online. A separate workflow illustrating the screening of PCB-related signals in GC-MS data is available on OSF:

Quick start

Read an example MSDX file

msdx_file <- system.file("extdata", "ketones.msdx", package = "msdxr")
gcms <- msdxr::ReadMsdx(msdx_file)

ReadMsdx() returns a list of spectra (one per scan), with metadata stored as the settings attribute. Each spectrum contains:

  • rt - retention time (seconds)
  • scan_no - scan number
  • mz - mass-to-charge ratios
  • intst - ion intensities
  • tic - total ion current

Plot total ion chromatogram

tic <- msdxr::ExtractTic(gcms)
plot(
  tic$rt,
  tic$tic,
  type = "l",
  xlab = "Retention time (s)",
  ylab = "Intensity",
  main = "Total Ion Chromatogram"
)

Plot mass spectrum of the first peak

ms <- msdxr::ExtractSpectrum(gcms, rt = 423)
plot(
  ms$mz,
  100 * ms$intst / max(ms$intst),
  xlim = c(10, 200),
  type = "h",
  xlab = "m/z",
  ylab = "Intensity",
  main = sprintf("rt = %.1f s; scan = %d", ms$rt, ms$scan_no)
)

Notes

  • Full support is currently limited to files containing a single segment and scan event.
  • The MSDX format is proprietary and not publicly documented.

About

Read GC-MS Data Files in the Chromatec MSDX Format

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages