Read chromatogram data streams from 'Shimadzu' .gcd files.
read_shimadzu_gcd(
path,
what = "chroms",
format_out = c("matrix", "data.frame", "data.table"),
data_format = c("wide", "long"),
read_metadata = TRUE,
metadata_format = c("chromconverter", "raw"),
collapse = TRUE,
peaktable_format = c("chromatographr", "original")
)A 2D chromatogram in the format specified by data_format and
format_out. If data_format is wide, the chromatogram will be returned
with retention times as row names and a single column for the intensity. If
long format is requested, two columns will be returned: one for the
retention time and one for the intensity. The format_out argument
determines whether the chromatogram is returned as a matrix, data.frame,
or data.table. Metadata are attached to the chromatogram as attributes
if read_metadata is TRUE.
Path to 'Shimadzu' .gcd file.
What stream to get: current options are chromatograms
(chroms) and/or peak lists (peak_table). If a stream
is not specified, the function will default to chroms.
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).
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 chromatogram data streams from 'Shimadzu' .gcd files.
GCD files are encoded as 'Microsoft' OLE documents. The parser relies on the
olefile package in Python to unpack the
files. The chromatogram data is encoded in streams titled
LSS Raw Data:Chromatogram Ch<#>. Each stream begins with a 24-byte
header:
4 bytes: segment label (17234).
4 bytes: Little-endian integer specifying the sampling interval in milliseconds.
4 bytes: Little-endian integer specifying the number of values in the stream.
4 bytes: Little-endian integer specifying a byte count, which does not match the size of the stream exactly.
8 bytes of 00s
After the header, the data are encoded as 64-bit (little-endian)
floating-point numbers. Retention times are derived from the number of
values and the sampling interval encoded in the header, rather than read
from the file: the nth value is placed at n times the sampling
interval.
Other 'Shimadzu' parsers:
read_shimadzu(),
read_shimadzu_lcd(),
read_shimadzu_method(),
read_shimadzu_qgd(),
read_sz_lcd_2d(),
read_sz_lcd_3d(),
read_sz_tables()
if (FALSE) {
read_shimadzu_gcd("path/to/file.gcd")
}
Run the code above in your browser using DataLab