rainbow.sequence_from_asm

sequence_from_asm(document, name='asm')[source]

Reconstructs a DataSequence from an ASM liquid- or gas-chromatography document.

The inverse of sequence_to_asm(): each liquid chromatography document becomes one injection (a DataDirectory), the device system document becomes the sequence’s instrument, and any processed-data peaks are reattached to the injections they belong to.

Round-trip caveat: only what sequence_to_asm() writes is recoverable. Injections are named from the injection identifier the document carries, which is the .D folder name rainbow exported them under, falling back to the sample identifier and then to position. A liquid chromatography run that records no injection volume has no injection document at all (the schema requires the volume in the same document as the identifier), so such a run comes back under its sample identifier. Metadata rainbow reads but does not export (column temperature, flow rate, dilution) is not restored.

Parameters:
  • document (dict) – An ASM document (e.g. from json.load).

  • name (str, optional) – Name for the reconstructed DataSequence.

Returns:

DataSequence.