polymerist.rdutils.rdgraphs =========================== .. py:module:: polymerist.rdutils.rdgraphs .. autoapi-nested-parse:: Utilities for interfacing between RDKit Mols and their graph representations Attributes ---------- .. autoapisummary:: polymerist.rdutils.rdgraphs.DEFAULT_ATOM_PROPS polymerist.rdutils.rdgraphs.DEFAULT_BOND_PROPS Functions --------- .. autoapisummary:: polymerist.rdutils.rdgraphs.chemical_graph polymerist.rdutils.rdgraphs.rdmol_to_networkx Module Contents --------------- .. py:data:: DEFAULT_ATOM_PROPS :value: ('AtomMapNum', 'AtomicNum', 'Degree', 'ExplicitValence', 'FormalCharge', 'ImplicitValence',... .. py:data:: DEFAULT_BOND_PROPS :value: ('BondDir', 'BondType', 'BondTypeAsDouble', 'Idx', 'IsAromatic', 'IsConjugated', 'Stereo') .. py:function:: chemical_graph(mol: rdkit.Chem.Mol) -> networkx.Graph Converts an RDKit molecule to its network form, with nodes numbered by atom indices Returned Graph does NOT contain any chemical information or properties of any bonds or atoms, only topological (i.e. connectivty) information .. py:function:: rdmol_to_networkx(rdmol: rdkit.Chem.Mol, atom_attrs: Iterable[str] = DEFAULT_ATOM_PROPS, bond_attrs: Iterable[str] = DEFAULT_BOND_PROPS) -> networkx.Graph Convert an RDKit Mol into a NetworkX Graph with nodes numbered according to atom IDs and bonds between corresponding atoms Copies over all Atom and Bond Props that have been set. Can also port other atom and bond properties over to the resulting graph by specifying attributes to copy over