Read PDA, chromatogram, mass spectrometry and peak table streams from
'Shimadzu' .lcd files.
read_shimadzu_lcd(
path,
what,
format_out = c("matrix", "data.frame", "data.table"),
data_format = c("wide", "long"),
read_metadata = TRUE,
metadata_format = c("chromconverter", "raw"),
scale = TRUE,
sparse = TRUE,
centroided = TRUE,
collapse = TRUE,
peaktable_format = c("chromatographr", "original")
)A named list with one element per stream requested, or the element
itself where there is only one and collapse is TRUE. Chromatograms and
the PDA data are returned in the format specified by data_format and
format_out. In wide format, retention times are the rows, and each 2D
chromatogram has a single intensity column while the PDA data have one
column per wavelength. If long format is requested, the retention time
and the intensity are returned as columns, alongside the detector, channel,
wavelength and unit for a 2D chromatogram. The format_out argument
determines whether they are returned in matrix, data.frame, or
data.table format. Mass spectra and peak tables are always long.
Metadata are attached as attributes when read_metadata is TRUE.
Path to 'Shimadzu' .lcd file.
What stream to get: current options are DAD (for which PDA
is accepted as a synonym, since that is what 'Shimadzu' calls the same
detector), chromatograms (chroms), TIC, mass spectra (MS1, MS2, or
MS for both), and/or peak lists (peak_table). MS1 and MS2 count
stages of mass selection rather than name a scan type, so a triple
quadrupole acquisition can land on either: an MRM scan selects a precursor
in Q1 (the first quadrupole) and a product in Q3 (the third), so it is
MS2, while a SIM scan sets Q1 and Q3 to the same mass, selecting nothing
after the collision cell, and so is MS1.
If a stream is not specified, the richest one the file contains is returned:
DAD if there is a PDA stream, otherwise chroms, and otherwise MS for a
file whose only detector is the mass spectrometer. The mass spectrometry
streams are read from whichever container the file uses: QTFL RawData
(centroided quadrupole time-of-flight data), TLM Raw Data (triple
quadrupole full scan, product-ion scan, MRM and SIM data), TTFL Raw Data
(ion trap time-of-flight profile data) or Mass Raw Data (centroided or
profile single quadrupole data).
Class of output. Either matrix, data.frame, or
data.table.
Whether to return data in wide (default) or long format.
Logical. Whether to attach metadata. Defaults to TRUE.
Format to output metadata. Either chromconverter
(standardized field names) or raw (vendor field names, unmapped).
Whether to scale the data by the scaling factor present in the
file. Defaults to TRUE.
Logical. Whether to return mass spectra in sparse format
(excluding zeros), as call_rainbow() does. Defaults to TRUE. Applies
only to triple quadrupole profile spectra, whose m/z grid is largely
empty; ignored for every other stream.
Logical. Whether to return the centroided single
quadrupole scans (TRUE, the default) or the profile scans (FALSE), which
some methods record as a separate event. Ignored for every other stream.
Logical. Whether to collapse lists that only contain a single
element. Defaults to TRUE.
Whether to return peak tables in the standard
chromatographr layout (the default) or with all the columns the file
provides (original). A chromatographr table has the columns rt, start,
end, area, height and FWHM (the full width at half maximum), with
times in the same unit as the format's chromatograms and NA where the file
does not record a value.
Ethan Bass
A parser to read data from 'Shimadzu' .lcd files. LCD files are
encoded as 'Microsoft' OLE documents. The parser relies on the
olefile package in Python to unpack the
files. Each detector writes its own storage, and this function dispatches
over them:
PDA (PDA 3D Raw Data:3D Raw Data), requested as DAD: one
delta-encoded segment per retention time, each holding a full spectrum.
Read by read_sz_lcd_3d(), which documents the segment header and the
delta encoding.
Chromatograms (LSS Raw Data:Chromatogram Ch<#>): one stream per
channel, delta-encoded in the same way. Read by read_sz_lcd_2d().
Quadrupole time-of-flight mass spectra (QTFL RawData): centroided
scans stored as a scan header, a block of flight times and a block of
intensities, with the mass axis reconstructed from the calibration table in
the file. Read by read_sz_qtof(), which documents the scan header, the
flight-time conversion and the intensity scaling. The total ion current is
held separately, in Centroid SumTIC (read_sz_qtof_tic()).
Triple quadrupole mass spectra (TLM Raw Data): zlib-compressed scan
records located through a spectrum index, covering full scan, product-ion
scan, MRM and SIM acquisitions. Read by read_sz_tlm(), which documents the
index, the scan header and the layout of each scan type. The total ion
current is again held separately, in TIC Data.
Ion trap time-of-flight mass spectra (TTFL Raw Data): run-length
encoded profile scans from the LCMS-IT-TOF, with the mass axis interpolated
between the calibrant ions stored in the file. Read by read_sz_ittof(),
which documents the scan header, the encoding and the calibration. The total
ion current is read from the scan headers (read_sz_ittof_tic()).
Single quadrupole mass spectra (Mass Raw Data): centroided and
profile scans from instruments such as the LCMS-2020, located through a
spectrum index. Read by read_sz_sq(), which documents the scan header,
the records and the approximate profile m/z axis. The
total ion current is held separately, in TIC Data (read_sz_sq_tic()).
Peak tables (Peak Table): integration results as reported by
'LabSolutions', one stream per channel. Read by read_sz_tables(), which
documents the two record layouts.
The mass spectrometry containers are mutually exclusive: a file holds one of them, according to the instrument that wrote it.
A mass spectrometry run is divided into acquisition events: the scan
functions defined by the method, each with its own polarity, MS level and
mass range, which the instrument cycles through as the run proceeds. The
mass spectrometry streams are reported per event --- TIC returns one
chromatogram for each, and the scan_info attribute of a table of spectra
names the event every scan came from.
Other 'Shimadzu' parsers:
read_shimadzu(),
read_shimadzu_gcd(),
read_shimadzu_method(),
read_shimadzu_qgd(),
read_sz_lcd_2d(),
read_sz_lcd_3d(),
read_sz_tables()
if (FALSE) {
read_shimadzu_lcd(path)
}
Run the code above in your browser using DataLab