rdtools.resonance.base#
Modules for base operations of resonance structure generation and analysis.
- class rdtools.resonance.base.ResonanceAlgoRegistry#
Bases:
object
Registry for resonance algorithms.
- classmethod get(name: str) Callable[[...], Any] #
Get a registered resonance algorithm by name.
- Parameters:
name (str) – Name of the resonance algorithm.
- Returns:
Callable[…, Any] – The registered algorithm function.
- classmethod register(name: str) Callable[[...], Any] #
Register a resonance algorithm.
- Parameters:
name (str) – Name of the resonance algorithm.
- Returns:
Callable[…, Any] – A decorator that registers the algorithm.
- rdtools.resonance.base.generate_resonance_structures(mol: RWMol, keep_isomorphic: bool = False, copy: bool = True, backend: Literal['all', 'rdkit', 'rmg'] = 'all', **kwargs: Any) list[Mol] #
Generate resonance structures for a molecule.
- Parameters:
mol (Chem.RWMol) – A charged molecule in RDKit RWMol.
keep_isomorphic (bool, optional) – If keep isomorphic resonance structures. Defaults to
False
.copy (bool, optional) – If copy the input molecule. Defaults to
True
.backend (Literal["all", "rdkit", "rmg"], optional) – The backend to use for generating resonance structures. Defaults to
"all"
.**kwargs (Any) – Additional arguments for the resonance algorithms.
- Returns:
list[Chem.Mol] – A list of resonance structures.
- Raises:
ValueError – If the backend is invalid.