View source: R/read_shimadzu_qgd.R
read_shimadzu_qgd | R Documentation |
Reads 'Shimadzu GCMSsolution' .qgd
GC-MS data files.
read_shimadzu_qgd(
path,
what = c("MS1", "TIC"),
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 'Shimadzu' QGD file. |
what |
What stream to get: current options are |
format_out |
Matrix or data.frame. |
data_format |
Either |
read_metadata |
Logical. Whether to attach metadata. Defaults to |
metadata_format |
Format to output metadata. Either |
collapse |
Logical. Whether to collapse lists that only contain a single
element. Defaults to |
The MS data is stored in the "GCMS Raw Data" storage, which contains a
MS Raw Data
stream with MS scans, a TIC Data
stream containing
the total ion chromatogram, and a Retention Time
stream containing the
retention times. All known values are little-endian. The retention time
stream is a simple array of 4-byte integers. The TIC stream is a simple array
of 8-byte integers corresponding to retention times stored in the
retention time stream. The MS Raw Data stream is blocked by retention time.
Each block begins with a header consisting of the following elements:
scan number (4-byte integer)
retention time (4-byte integer)
unknown (12-bytes)
number of bytes in intensity values (2-byte integer)
unknown (8-bytes)
After the header, the rest of the block consists of an array of mz values and intensities. The mz values are encoded as 2-byte integers where each mz value is scaled by a factor of 20. Intensities are encoded as (unsigned) integers with variable byte-length defined by the value in the header.
A 2D chromatogram from the chromatogram stream in matrix
,
data.frame
, or data.table
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
.
A chromatogram or list of chromatograms in the format specified by
data_format
and format_out
. If data_format
is wide
,
the chromatogram(s) will be returned with retention times as rows 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 chromatograms are returned
as a matrix
, data.frame
, or data.table
. Metadata can be
attached to the chromatogram as attributes
if
read_metadata
is TRUE
.
This parser is experimental and may still need some work. It is not yet able to interpret much metadata from the files.
Ethan Bass
Other 'Shimadzu' parsers:
read_shimadzu()
,
read_shimadzu_gcd()
,
read_shimadzu_lcd()
,
read_sz_lcd_2d()
,
read_sz_lcd_3d()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.