Title: Extract and Analyze EchoMS Data from Sciex Wiff Files
Version: 0.2.4
Description: Read raw and processed data from acoustic ejection mass spectrometry (AEMS) files produced by the Sciex EchoMS instrument. Includes functions to create interactive reader objects, extract raw intensity measurements, mass spectra, and fully-processed mass-transition intensity areas. Methods for data processing and analysis are described in Rimmer et al. (2025) <doi:10.1021/acs.analchem.5c03730>. Supports both multiple reaction monitoring (MRM) and full-scan (neutral loss and precursor ion) data formats.
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.1
Imports: rtms
Depends: R (≥ 2.10)
LazyData: true
Suggests: ggplot2
NeedsCompilation: no
Packaged: 2026-01-09 20:52:48 UTC; ntwarog
Author: Mary Ashley Rimmer [aut], Nathaniel Twarog [aut, cre], Lei Yang [aut]
Maintainer: Nathaniel Twarog <nathaniel.twarog@stjude.org>
Repository: CRAN
Date/Publication: 2026-01-14 18:10:02 UTC

Example wiff reader object

Description

An object of class rtmsWiffReader produced by running newWiffReader on a .wiff and .wiff.scan file. The files in question contain multiple reaction monitoring (MRM) data measuring three mass transitions, corresponding to the detection of the compounds carbamazepine, warfarin, and verapamil. The EchoMS run included measurements of 320 ejections, each three seconds apart from 320 wells of a 384-well plate.

Usage

exampleWiff

Format

A data structure of type rtmsWiffReader; a description of the format can be found in the description for newWiffReader

Details

Note that the wiff reader object does not contain all data from the .wiff and .wiff.scan files. It included to demonstrate some of the basic function in the package.


Get the total area for given masses for all wells

Description

Get the total area for given masses for all wells

Usage

getAllFullScanAreas(scanfile, tic, sample, ejections, peaks)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram of the format outputby getTIC() or getAllTIC()

sample

The particular object from the samples field of the rtmsWiffReader object, which in this case contains binary offsets into the .wiff.scan file

ejections

An ejection table listing the timing and boundaries of the total ion chromatogram peaks for all shots in the run, as returned by measureEjections()

peaks

A named list of peak objects of class rtmsPeak

Details

The table returned includes a measurement of total area for each of the mass transitions listed in sample. It contains one row for each measured shot each mass transition, with the following columns:

Value

A data frame containing the total intensity for each rtmsPeak given and each ejection; see Details for column specifics.


Extract mass spectra for all wells

Description

Extract mass spectra for all wells

Usage

getAllFullScanSpectra(scanfile, tic, sample, ejections)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram of the format outputby getTIC() or getAllTIC()

sample

The particular object from the samples field of the rtmsWiffReader object, which in this case contains binary offsets into the .wiff.scan file

ejections

An ejection table listing the timing and boundaries of the total ion chromatogram peaks for all shots in the run, as returned by measureEjections()

Value

A list of objects of class rtmsSpectrum containing the full extracted mass spectra for each ejection


Extract the peak areas for MRM mass transitions for all wells

Description

Extract the peak areas for MRM mass transitions for all wells

Usage

getAllMRMAreas(scanfile, tic, sample, ejections, removeBaseline = TRUE)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram data.frame as extracted by getTIC() or getAllTIC()

sample

A "sample" object representing a run in a .wiff file, from the samples field of an rtmsWiffReader object, containing information about the mass transitions measured in that run

ejections

An ejection table listing the timing and boundaries of the total ion chromatogram peaks for all shots in the run, as returned by measureEjections()

removeBaseline

If TRUE, baseline intensity for each mass transition will be subtracted from the intensities in each ejection, to account for baseline intensities measured near the lower limit of quantitation

Details

The table return includes a measurement of total area for each of the mass transitions listed in sample. It contains one row for each measured shot each mass transition, with the following columns:

Value

A data frame containing the total intensity for each mass transition and each ejection; see Details for column specifics.


Extract all total ion chromatograms from a Wiff file

Description

Extract all total ion chromatograms from a Wiff file

Usage

getAllTIC(wiff)

Arguments

wiff

A wiff reader object of class rtmsWiffReader

Value

A list of total ion chromatograms of the format extracted by getTIC(), one for each run in the given .wiff file

Examples

wiff <- exampleWiff

tics <- getAllTIC(wiff)
tic <- tics[[1]]

Get the total area for given masses for a particular well

Description

Get the total area for given masses for a particular well

Usage

getFullScanAreas(scanfile, tic, sample, ejections, peaks, well)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram of the format outputby getTIC() or getAllTIC()

sample

The particular object from the samples field of the rtmsWiffReader object, which in this case contains binary offsets into the .wiff.scan file

ejections

An ejection table listing the timing and boundaries of the total ion chromatogram peaks for all shots in the run, as returned by measureEjections()

peaks

A named list of peak objects of class rtmsPeak

well

The well (a string) or well index (an integer) to be measured

Details

The table return includes a measurement of total area for each of the mass transitions listed in sample. It contains one row for each measured shot each mass transition, with the following columns:

Value

A data frame containing the total intensity for rtmsPeak gvien and each ejection; see Details for column specifics.


Extract raw Wiff full scan data

Description

Extract raw Wiff full scan data

Usage

getFullScanData(scanfile, tic, sample, removeZeros = FALSE)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A (possibly partial) total ion chromatogram of the format output by getTIC() or getAllTIC() referring to the range of timepoints to be extracted

sample

The particular object from the samples field of the rtmsWiffReader object, which in this case contains binary offsets into the .wiff.scan file

removeZeros

If FALSE (the default) all intensity measuremens for all time points and m/z values will be extractd and returned; if TRUE, only values greater than zero will be returned; this can result in a much smaller output and may be useful for calculating areas

Details

The data frame output by the function contains all the intensity data compressed into the .wiff.scan file for the given range of times; it has the following columns:

Value

A data frame containing all raw data for the given range (see Details)


Extract a full mass spectrum for a given well

Description

Extract a full mass spectrum for a given well

Usage

getFullScanSpectrum(scanfile, tic, sample, ejections, well)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram of the format outputby getTIC() or getAllTIC()

sample

The particular object from the samples field of the rtmsWiffReader object, which in this case contains binary offsets into the .wiff.scan file

ejections

An ejection table listing the timing and boundaries of the total ion chromatogram peaks for all shots in the run, as returned by measureEjections()

well

The well (a string) or well index (an integer) to be measured

Value

An object of class rtmsSpectrum representing the full mass spectrum for the given well


Extract the peak areas for MRM mass transitions for a given well

Description

Extract the peak areas for MRM mass transitions for a given well

Usage

getMRMAreas(scanfile, tic, sample, ejections, well, removeBaseline = TRUE)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram data.frame as extracted by getTIC() or getAllTIC()

sample

A "sample" object representing a run in a .wiff file, from the samples field of an rtmsWiffReader object, containing information about the mass transitions measured in that run

ejections

An ejection table listing the timing and boundaries of the total ion chromatogram peaks for all shots in the run, as returned by measureEjections()

well

The well (a string) or well index (an integer) to be measured

removeBaseline

If TRUE, baseline intensity for each mass transition will be subtracted from the intensities in each ejection, to account for baseline intensities measured near the lower limit of quantitation

Details

The table return includes a measurement of total area for each of the mass transitions listed in sample. It contains one row for each measured shot each mass transition, with the following columns:

Value

A data frame containing the total intensity for each mass transition and each ejection; see Details for column specifics.


Extract full chromatograms for each mass transition

Description

Extract full chromatograms for each mass transition

Usage

getMRMChromatograms(scanfile, tic, sample)

Arguments

scanfile

A file path to a Sciex raw scan file (extension .wiff.scan) containing the raw data referenced by the .wiff file from which the other parameters were extracted

tic

A total ion chromatogram data.frame as extracted by getTIC() or getAllTIC()

sample

A "sample" object representing a run in a .wiff file, from the samples field of an rtmsWiffReader object, containing information about the mass transitions measured in that run

Value

A single data frame expressing all chromatograms in a "long" format, with the following columns:


Extract a total ion chromatogram (TIC) from a Wiff file

Description

Extract a total ion chromatogram (TIC) from a Wiff file

Usage

getTIC(wiff, index = 1)

Arguments

wiff

A wiff reader object of class rtmsWiffReader

index

The particular run within the wiff file for which the TIC should be extracted. Defaults to 1, the first (and often only) run.

Details

The total ion chromatogram data in a .wiff file contains data for every moment at which the EchoMS took a measurement. Each measurement is represented by a single row in the returned data frame, with the following four values:

Value

A data frame containing the TIC data (see Details)

Examples

wiff <- exampleWiff

tic <- getTIC(wiff)

# Plot the first 60 seconds of the total ion chromatgram using [ggplot2]
ggplot2::ggplot(tic,ggplot2::aes(x=time,y=intensity))+
	ggplot2::geom_line(color="red")+
	ggplot2::xlim(0,60)

List of Shot Names in a given Wiff File

Description

List of Shot Names in a given Wiff File

Usage

getWiffShots(wiff)

Arguments

wiff

A wiff reader object of class rtmsWiffReader

Details

The .wiff file includes these shot names in the order in which they were input by the user. They are generally names of wells in a plate, but the order in which they are given by the user is not necessarily the order in which the EchoMS will sample them. By default, the EchoMS will use a more "efficient" ordering, moving back and forth across the rows of the plate. So the shot names here may not correlate in order with the measurements represented by the intensities in the total ion chromatogram.

Value

A character vector containing the shot names for all shots fired in each run in a given file. Note: not necessarily in the correct order (see Details).

Examples

wiff <- exampleWiff

shots <- getWiffShots(wiff)

Measure total ion chromatogram peaks to estimate ejection time

Description

Measure total ion chromatogram peaks to estimate ejection time

Usage

measureEjections(
  wiff,
  efficientPath = TRUE,
  center = 3,
  guess = NULL,
  index = 1,
  shots = NULL
)

## S3 method for class 'rtmsWiffReader'
measureEjections(
  wiff,
  efficientPath = TRUE,
  center = 3,
  guess = NULL,
  index = 1,
  shots = NULL
)

## Default S3 method:
measureEjections(
  wiff,
  efficientPath = TRUE,
  center = 3,
  guess = NULL,
  index = 1,
  shots = NULL
)

Arguments

wiff

Either an ojbect of class rtmsWiffReader, or a data frame representing a full EchoMS total ion chromatogram as extracted by getTIC() or getAllTIC()

efficientPath

If TRUE, the extraction proceeds under the assumption that shots were fired from the wells named in shots using the "efficient" method of the EchoMS, which proceeds left to right across odd rows (A, C, E, etc.) and right to left across even rows (B, D, F, etc.). If FALSE, shots are assumed to be fired from left to right across all rows

center

A guess at the timing (in seconds) between EchoMS shots. Most runs are 3 seconds apart, but the EchoMS does permit a fast mode. If a fast mode is used, 0.3 seconds should be added to fast mode timing, as the Echo requires those 0.3 to eject a droplet

guess

If included, used as the guess for the timing of the first shot. If desired this can usually be estimated visually from a plot of the total ion chromatogram intensity. Actual shot timing will still be optimized to align with TIC intensities. If NULL (the default), the function will guess at the timing of the first shot based on existing runs.

index

The particular run within the wiff file for which the TIC should be extracted. Defaults to 1, the first (and often only) run.

shots

A list of shot names as extracted by getWiffShots(); each name should begin with an alphanumeric well name (e.g. "A01", "B7", "F15") and may contain the string "Marker" to indicate the well was used as a marker.

Details

The function assumes equally timed ejections, approximately center seconds apart, can be found in the total ion chromatogram. Once the timing of these peaks is selected, the chromatogram is analyzed to locate the boundaries of these peaks, using baseline noise or local minima to draw these boundaries. The function returns a data frame with one row for each peak, with the following columns:

Value

A data frame of measured ejections (see Details)

Examples

wiff <- exampleWiff

# Works if file is run with 3 seconds between peaks and shots are fired
# from wells in the efficient "back-and-forth" path
ejections <- measureEjections(wiff)

Open a Sciex EchoMS wiff File for Reading

Description

Open a Sciex EchoMS wiff File for Reading

Usage

newWiffReader(wiffFile, wiffScanFile = NULL)

Arguments

wiffFile

A valid file path to the Sciex data file (extension .wiff) containing the metadata for one or more EchoMS runs

wiffScanFile

An optional file path the the Sciex scan file (extension .wiff.scan) containing the full raw EchoMS data

Details

The reader object produced by this function is of class rtmsWiffReader, and contains the information necessary to extract more detailed data from this file and the associated .wiff.scan file. It contains the following fields:

Value

An object of class rtmsWiffReader (see Details)


Fully process a Full Scan Wiff and scan File

Description

A convenient wrapper function to extract all full scan areas from a file without storing the intermediate reader and ejection data structures.

Usage

processAllFullScanAreas(wiffFile, wiffScanFile, peaks, ...)

Arguments

wiffFile

A valid file path to the Sciex data file (extension .wiff) containing the metadata for one or more EchoMS runs

wiffScanFile

An file path the the Sciex scan file (extension .wiff.scan) containing the full raw EchoMS data

peaks

A named list of peak objects of class rtmsPeak, often generated by rtmsPeakList()

...

Additional arguments passed to measureEjections()

Value

A list with two objects: ejections, a data frame listing all ejections for all samples in the WIFF file, with an additional wiffSample column specifying which sample each ejection was extracted from; and massAreas, a data frame of the format returned by getAllFullScanAreas(), also with an additional wiffSample column


Process an MRM file in total

Description

This is a convenience function that performs an end to end analysis of an Sciex MRM run; it can be used when the intermediate data structures (total ion chromatograms, shot lists, .wiff file readers) are not required.

Usage

processAllMRMAreas(wiffFile, wiffScanFile, removeBaseline = TRUE, ...)

Arguments

wiffFile

A valid file path to the Sciex data file (extension .wiff) containing the metadata for one or more EchoMS runs

wiffScanFile

An valid file path the the Sciex scan file (extension .wiff.scan) containing the full raw EchoMS data

removeBaseline

If TRUE, baseline intensity for each mass transition will be subtracted from the intensities in each ejection, to account for baseline intensities measured near the lower limit of quantitation

...

Additional optional parameters to be passed to measureEjections()

Value

A list containing two data frames: ejections, with all extracted TIC peaks for all runs, as output by measureEjections(), and massAreas, containing the measured areas for all mass transitoins and all peaks in all runs, as output by getMRMAreas(). Both data frames contain an addtional wiffSample column indicating which run within the file the values were extracted from.