Overview
Thechemical_components module provides access to the Chemical Components Dictionary (CCD) from the Protein Data Bank. It includes classes and utilities for working with chemical component data in mmCIF format.
Module Path: alphafold3.constants.chemical_components
Reference: CCD CIF format documentation
Classes
Ccd
Path to the CCD pickle file. If None, uses the default CCD pickle file included in the source code.
A string containing the user-provided CCD. This has to conform to the same format as the CCD (see wwPDB CCD). If provided, takes precedence over the CCD for the same key. This can be used to override specific entries in the CCD if desired.
Methods
__getitem__(key: str)
__getitem__(key: str)
Returns the chemical component data for the given key.Parameters:
key: Component name (e.g., ‘ARG’, ‘MSE’)
get(key, default)
get(key, default)
Returns the chemical component data for the given key, or default if not found.Parameters:
key: Component namedefault: Value to return if key is not found
Standard Mapping Methods
Standard Mapping Methods
The
Ccd class implements the full Mapping interface:__contains__(key: str) -> bool: Check if a component exists__iter__() -> Iterator[str]: Iterate over component names__len__() -> int: Get the number of componentskeys() -> KeysView[str]: Get all component namesvalues() -> ValuesView[Mapping[str, Sequence[str]]]: Get all component dataitems() -> ItemsView[str, Mapping[str, Sequence[str]]]: Get all key-value pairs
Example Usage
ComponentInfo
The full name of the component
The type of the component (e.g., ‘L-peptide linking’, ‘non-polymer’)
Alternative names for the component
Chemical formula
Molecular weight
Parent component ID for non-standard monomers
Flag indicating if the component is standard:
'.': Unset for non-polymers (e.g., water, ions)'y': Standard component without a standard parent (e.g., MET)'n': Non-standard component (e.g., MSE)
SMILES representation (canonical SMILES preferred, falls back to regular SMILES)
Functions
mmcif_to_info
ComponentInfo object. Missing fields are left empty.
mmCIF dictionary containing component data
ComponentInfo object with parsed data
Example:
component_name_to_info
ComponentInfo. Results are cached for performance.
The chemical components dictionary
The component name (e.g., ‘ARG’, ‘MSE’)
ComponentInfo object or None if not found
Example:
type_symbol
The chemical components dictionary
The component name (e.g., ‘ARG’)
The atom name (e.g., ‘CB’, ‘OXT’, ‘NH1’)
Constants
_CCD_PICKLE_FILE
Internal Functions
_load_ccd_pickle_cached
Ccd class.