Generators¶
Classes for generating conformer ensembles using standard rdkit algorithms or torsion scans.
Example:¶
We can use geometrical ranges (in the GeometryScanner classes) to build
ensembles along specific collective variables:
import stk
import bbprepared
import stko
bb = stk.BuildingBlock(smiles="C1=CC=C(C=C1)C2=CC=CC=C2")
The desired range is actually a change from the initial configuration and can be set by the user (using SMARTS strings). Any combination of variables can be used, although you will start hitting a combinatorial nightmare with too many ranges. Once you have an ensemble, you can do normal analysis.
generator = bbprepared.generators.GeometryScanner(
target_ranges=(
bbprepared.generators.BondRange(
smarts="[#6X3H0]-!@[#6X3H0]",
expected_num_atoms=2,
scanned_ids=(0, 1),
scanned_range=[-0.5, -0.3, -0.2, 0, 0.2, 0.3, 0.5],
),
),
)
ensemble = generator.generate_conformers(bb)
energies = [
stko.MMFFEnergy(ignore_inter_interactions=False).get_energy(
conformer.molecule
)
for conformer in ensemble.yield_conformers()
]