xnn.gnn.featurizers.molgraph.canonical_resonance#
- xnn.gnn.featurizers.molgraph.canonical_resonance(mol)[source]#
The resonance structure of
molwith the fewest formal charges.The structures of RDKit’s resonance enumeration with the molecule’s total charge are narrowed to those with the fewest charged atoms, then the smallest sum of absolute charges. The input is kept when it is among them; otherwise the one with the smallest canonical SMILES is taken.
- Parameters:
mol (rdkit.Chem.Mol) – A sanitized molecule.
- Returns:
The chosen structure (a copy, atom order unchanged).
- Return type:
rdkit.Chem.Mol