schrodinger.application.scaffold_enumeration.rdcml module

Basic CML reader: http://www.xml-cml.org/

schrodinger.application.scaffold_enumeration.rdcml.parse_and_drop_xmlns(source)

Parses source via xml.etree.ElementTree.iterparse, and removes namespace prefix (if present) from tags and attributes.

Parameters

source (str or file-like) – File name or file-like object.

Returns

Root of the tree.

Return type

xml.etree.ElementTree.Element

schrodinger.application.scaffold_enumeration.rdcml.rdk_mol_from_cml_element(xml_molecule, prop_prefix='cml_')

Instantiates rdkit.Chem.Mol from the XML element.

Parameters
  • xml_molecule (xml.etree.ElementTree.Element) – XML element that represents CML molecule.

  • prop_prefix (str) – Prefix to be added to the CML property names.

Returns

RDKit molecule.

Return type

rdkit.Chem.ROMol

class schrodinger.application.scaffold_enumeration.rdcml.CmlFileReader(filename, prop_prefix='cml_')

Bases: contextlib.AbstractContextManager

Does not need to be context manager (such need may arise in case we switch to a different XML parser).

__init__(filename, prop_prefix='cml_')