supplier
- supplier(version: VersionHint | None = None, *, prefix: Sequence[str] | None = None, **kwargs: Any) Generator[rdkit.Chem.ForwardSDMolSupplier][source]
Get a
rdkit.Chem.ForwardSDMolSupplierfor the given version of ChEMBL.- Parameters:
version – The version number of ChEMBL to get. If none specified, uses
latest()to look up the latest.prefix – The directory inside
pystowto usekwargs – keyword arguments to pass through to
rdkit.Chem.ForwardSDMolSupplier, such assanitizeandremoveHs.
- Yields:
A supplier to be used in a context manager
In the following example, a supplier is used to get fingerprints and SMILES.
from rdkit import Chem import chembl_downloader data = [] with chembl_downloader.supplier() as suppl: for i, mol in enumerate(suppl): if mol is None or mol.GetNumAtoms() > 50: continue fp = Chem.PatternFingerprint(mol, fpSize=1024, tautomerFingerprints=True) smi = Chem.MolToSmiles(mol) data.append((smi, fp))