rdkit
#
Convert between RDKit and mdtop
objects.
Functions:
-
from_rdkit
–Create a topology from an RDKit molecule.
-
to_rdkit
–Convert the Topology to an RDKit Mol object.
_EXCLUDED_ATOM_PROPS
module-attribute
#
_EXCLUDED_ATOM_PROPS = {
"_Name",
"_CIPCode",
"_CIPRank",
"_ChiralityPossible",
"_MolFileRLabel",
"_ReactionDegreeChanged",
"_protected",
"dummyLabel",
"molAtomMapNumber",
"molfileAlias",
"molFileValue",
"molFileInversionFlag",
"molRxnComponent",
"molRxnRole",
"smilesSymbol",
"__computedProps",
"isImplicit",
}
Exclude 'magic' atom properties when setting metadata from RDKit mols.
_EXCLUDED_BOND_PROPS
module-attribute
#
Exclude 'magic' bond properties when setting metadata from RDKit mols.
_EXCLUDED_MOL_PROPS
module-attribute
#
_EXCLUDED_MOL_PROPS = {
"MolFileComments",
"MolFileInfo",
"_MolFileChiralFlag",
"_Name",
"_smilesAtomOutputOrder",
"_smilesBondOutputOrder",
}
Exclude 'magic' molecule properties when setting metadata from RDKit mols.
_set_meta
#
Set metadata on an RDKit object.
Source code in mdtop/_io/rdkit.py
from_rdkit
#
from_rdkit(
mol: Mol, residue_name: str = "LIG", chain: str = ""
) -> Topology
Create a topology from an RDKit molecule.
Parameters:
-
mol
(Mol
) –The RDKit molecule to convert.
-
residue_name
(str
, default:'LIG'
) –The residue name to use for the ligand.
-
chain
(str
, default:''
) –The chain ID to use for the ligand.
Returns:
-
Topology
–The converted topology.
Source code in mdtop/_io/rdkit.py
to_rdkit
#
to_rdkit(topology: Topology) -> Mol
Convert the Topology to an RDKit Mol object.
Notes
- Currently this requires formal charges to be set on the atoms, and formal bond orders to be set on the bonds.
Returns:
-
Mol
–The RDKit Mol object.