orthonym.cli_sdf#
Note
Internal API. Names and behaviour may change between releases.
orthonym --sdf FILE: name every record of a MOL or SDF file.
Each record is read by RDKit (Chem.ForwardSDMolSupplier: sanitized, hydrogen atoms removed) and named
as an RDKit Mol is named (input_mol.smiles_for): through its proven SMILES, or its CXSMILES when the
record has an AND or OR stereo group (V3000 STEREO collections). The stereo is the file’s own: the
tetrahedral configurations RDKit reads from the wedge bonds (or from the coordinates of a 3D record), the
double-bond configurations from the coordinates, as the MDL format defines them, and none for an ‘either’
bond, a wavy bond or a crossed double bond. The coordinates are then dropped, so nothing is perceived
from them again while the structure is named.
A V2000 record’s chiral flag is not read: as in the standard InChI, which reads none by default, and as RDKit’s and many other writers set it (0 also for a structure of known configuration), the tetrahedral configurations of a record are absolute; a racemate or a relative configuration is stated by a V3000 STEREO collection (AND, OR).
The records become the lines of --batch: one output line per record, in the order of the file, the
first column the string that was named. A record RDKit cannot read, or whose SMILES does not hold it,
becomes a line no SMILES reader reads (‘<record 5>’), which --batch reports as it reports an unreadable
line (‘ERROR:’ and exit status 1), and its number and the reason go to the error stream. A record with no
atoms gives an empty line and a message.
- orthonym.cli_sdf.record_lines(path)#
(lines, problems): the string to name for each record ofpath(’’ for one that has none) and one message per record that has none.
- orthonym.cli_sdf.batch_file(path)#
A temporary file of:func:record_lines for
--batch, removed when the process ends; the problems are printed on the error stream. None whenpathcannot be read (--batchthen reports it).