boltz_data.rdkit#

RDKit utilities for data preparation.

Functions

rdmol_from_chemical_component(...)

Create an RDKit Mol object from a ChemicalComponent.

rdmol_from_definition(definition, /, *, ...)

Create an RDKit Mol object from an EntityDefinition.

rdmol_from_smiles(smiles, /)

Parse a SMILES string into an RDKit molecule.

boltz_data.rdkit.rdmol_from_chemical_component(chemical_component, /)[source]#

Create an RDKit Mol object from a ChemicalComponent.

Return type:

Mol

Parameters:

chemical_component (ChemicalComponent)

boltz_data.rdkit.rdmol_from_definition(definition, /, *, chemical_component_dictionary)[source]#

Create an RDKit Mol object from an EntityDefinition.

Return type:

Mol

Parameters:
  • definition (ProteinDefinition | RNADefinition | DNADefinition | LigandCCDDefinition | LigandSMILESDefinition | BranchedPolymerDefinition)

  • chemical_component_dictionary (Mapping[str, ChemicalComponent])

boltz_data.rdkit.rdmol_from_smiles(smiles, /)[source]#

Parse a SMILES string into an RDKit molecule.

Parameters:

smiles (str) – A valid SMILES string representing the molecule.

Return type:

Mol

Returns:

An RDKit Mol object.

Raises:

ValueError – If the SMILES string is invalid or cannot be parsed.

Example

>>> mol = rdmol_from_smiles("CCO")  # Ethanol
>>> mol.GetNumAtoms()
3  # Without hydrogens