Skip to contents

Read 3D PDA data stream from 'Shimadzu' LCD files.

Usage

read_shimadzu_lcd(
  path,
  format_out = c("matrix", "data.frame"),
  data_format = c("wide", "long"),
  read_metadata = TRUE
)

Arguments

path

Path to LCD file.

format_out

Matrix or data.frame.

data_format

Either wide (default) or long.

read_metadata

Logical. Whether to attach metadata.

Value

A 3D chromatogram from the PDA 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.

Details

A parser to read PDA 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. The PDA data is encoded in a stream called PDA 3D Raw Data:3D Data Item. The PDA 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: ???

  • 4 bytes: Little-endian integer specifying the number of wavelength values in the segment.

  • 4 bytes: Little-endian integer specifying the total number of bytes in the segment.

  • 8 bytes of 00s

Each segment is divided into two sub-segments, which begin and end with an integer specifying the length of the sub-segment in bytes. All known values in this data stream are little-endian and the data are delta-encoded. The first hexadecimal digit of each value is a sign digit specifying the number of bytes in the delta and whether the value is positive or negative. The sign digit represents the number of hexadecimal digits used to encode each value. Even numbered sign digits correspond to positive deltas, whereas odd numbers indicate negative deltas. Positive values are encoded as little-endian integers, while negative values are encoded as two's complements. The value at each position is derived by subtracting the delta from the previous value.

Note

This parser is experimental and may still need some work. It is not yet able to interpret much metadata from the files.

Author

Ethan Bass