neurosnap.database.ccd module#
Chemical Component Dictionary metadata helpers.
- class neurosnap.database.ccd.CCD(code, name, smiles)[source]#
Bases:
objectMinimal Chemical Component Dictionary entry.
- code#
CCD identifier, typically 1-5 characters.
- name#
Human-readable component name.
- smiles#
SMILES string for the component (technically canonicalized but the canonicalization algorithm used by wwPDB is inconsistent with that of RDkit).
- smiles_canonical()[source]#
Return the RDKit-canonicalized SMILES string for this CCD entry.
- Return type:
- to_mol()[source]#
Return an RDKit molecule parsed from the canonical SMILES string.
- Return type:
- Returns:
RDKit molecule for the CCD entry.
- Raises:
ValueError – If the stored canonical SMILES cannot be parsed.
- neurosnap.database.ccd.get_ccd(code, *, cache_path='~/.cache/neurosnap/ccd_entries.json', overwrite=False, max_age_days=7, timeout=30)[source]#
Return a CCD entry by its component code.
- neurosnap.database.ccd.get_ccd_entries(*, cache_path='~/.cache/neurosnap/ccd_entries.json', overwrite=False, max_age_days=7, timeout=30)[source]#
Fetch and cache CCD metadata entries.
The CCD payload is cached locally and refreshed when the cached payload exceeds
max_age_daysbased on its embeddedcreated_attimestamp.- Parameters:
- Return type:
- Returns:
Dictionary mapping CCD code to
CCD.