View source: R/read_shimadzu_gcd.R
read_shimadzu_gcd | R Documentation |
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
)
path |
Path to GCD file. |
what |
What stream to get: current options are chromatograms
( |
format_out |
Class of output. Either |
data_format |
Either |
read_metadata |
Logical. Whether to attach metadata. |
metadata_format |
Format to output metadata. Either |
collapse |
Logical. Whether to collapse lists that only contain a single element. |
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 PDA data is encoded in a stream called PDA 3D Raw Data:3D Raw Data
.
The GCD data stream contains a segment for each retention time, beginning
with a 24-byte header.
The 24 byte header consists of the following fields:
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 file.
4 bytes: Little-endian integer specifying the total number of bytes in the file (However, this seems to be off by a few bytes?).
8 bytes of 00
s
After the header, the data are simply encoded as 64-bit (little-endian) floating-point numbers. The retention times can be (approximately?) derived from the number of values and the sampling interval encoded in the header.
A 2D chromatogram from the chromatogram stream in matrix
or
data.frame
format, according to the value of format_out
.
The chromatograms will be returned in wide
or long
format
according to the value of data_format
.
This parser is experimental and may still need some work. It is not yet able to interpret much metadata from the files.
Ethan Bass
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.