module
Chem::Mol
Overview
This module provides support for reading and writing MDL Mol files, including the connection table (CTAB) formats V2000 and V3000.
Format specification can be found in the CTFile Formats document published by BIOVIA.
NOTE The title in the MOL file will be used as residue name if it contains 3-4 uppercase letters and numbers only. In such case, the comment line will be set as the title of the structure.
WARNING Basic support only. MDL valence model (implicit hydrogens), connectivity information besides bonds, stereochemistry information (e.g., chirality, 3D), advanced properties like Sgroup, reaction data, etc. are unsupported/ignored. Therefore, hydrogens are expected to be defined explicitly.
Defined in:
chem/formats/mol.crClass Method Summary
-
.read(io : IO) : Structure
Reads the structure from io.
-
.read(path : Path | String) : Structure
Reads the structure from path.
-
.write(io : IO, obj : Structure | AtomView, variant : Mol::Variant = :v2000) : Nil
Writes a structure or group of atoms to io.
-
.write(path : Path | String, obj : Structure | AtomView, variant : Mol::Variant = :v2000) : Nil
Writes a structure or group of atoms to path.
Class Method Detail
Reads the structure from io. Supports both V2000 and V3000 variants.
Reads the structure from path. Supports both V2000 and V3000 variants.
Writes a structure or group of atoms to io.
The CTAB format is specified via variant: V2000 (legacy) or V3000.