Complex encoding convention¶
cTopo supports Complex objects when coordination is represented using RDKit dative bonds.
Rules (validated)¶
Rules enforced by ctopo.core.complex:
- coordination bonds must be dative
- each dative bond must be oriented donor → metal (metal is the end atom)
- metal atoms must not have non-dative bonds to non-metals
- metal–metal bonds may exist but must be non-dative
These constraints avoid ambiguous “coordination vs covalent” interpretations and keep donor detection consistent.
Creating complexes¶
You can build complexes from:
- an RDKit molecule + explicit
metal_atoms, or - SMILES (when the SMILES encodes dative bonds in the correct direction).
from ctopo import complex_from_smiles
# NOTE: this is a schematic example — exact SMILES depend on your RDKit conventions
cx = complex_from_smiles("[NH3]->[Cu+2]<-[NH3]")
print(cx.metal_atoms)
print(cx.donor_atoms)
Skeleton/topology in complexes¶
For complexes, donors are inferred from metal neighbors (non-metals bonded to the center). Skeleton/topology computations are performed on the ligand graph with metals removed, so donors are connected through the ligand skeleton rather than “via the metal”.
Practical notes¶
- If your input data uses a different coordination encoding (e.g. single bonds to metals),
you will need a conversion step before using
Complex. - Bridging ligands can be problematic for naive “remove metal → split fragments” extraction.