Skip to main content

Overview

The chemical_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

Chemical Components found in PDB (CCD) constants. This class wraps the CCD dictionary to prevent accidental mutation and provides a mapping interface.
os.PathLike[str] | None
default:"None"
Path to the CCD pickle file. If None, uses the default CCD pickle file included in the source code.
str | None
default:"None"
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

Returns the chemical component data for the given key.
Parameters:
  • key: Component name (e.g., ‘ARG’, ‘MSE’)
Returns: Mapping of CCD fields to their values
Returns the chemical component data for the given key, or default if not found.
Parameters:
  • key: Component name
  • default: Value to return if key is not found
Returns: Component data or default value
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 components
  • keys() -> KeysView[str]: Get all component names
  • values() -> ValuesView[Mapping[str, Sequence[str]]]: Get all component data
  • items() -> ItemsView[str, Mapping[str, Sequence[str]]]: Get all key-value pairs

Example Usage


ComponentInfo

A dataclass containing structured information about a chemical component.
str
The full name of the component
str
The type of the component (e.g., ‘L-peptide linking’, ‘non-polymer’)
str
Alternative names for the component
str
Chemical formula
str
Molecular weight
str
Parent component ID for non-standard monomers
str
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)
str
SMILES representation (canonical SMILES preferred, falls back to regular SMILES)

Functions

mmcif_to_info

Converts CCD mmCIF data to a structured ComponentInfo object. Missing fields are left empty.
Mapping[str, Sequence[str]]
mmCIF dictionary containing component data
Returns: ComponentInfo object with parsed data Example:

component_name_to_info

Converts a residue/component name to structured ComponentInfo. Results are cached for performance.
Ccd
The chemical components dictionary
str
The component name (e.g., ‘ARG’, ‘MSE’)
Returns: ComponentInfo object or None if not found Example:

type_symbol

Returns the element type for the given component name and atom name.
Ccd
The chemical components dictionary
str
The component name (e.g., ‘ARG’)
str
The atom name (e.g., ‘CB’, ‘OXT’, ‘NH1’)
Returns: Element type (e.g., ‘C’, ‘O’, ‘N’) or ’?’ if not found Examples:

Constants

_CCD_PICKLE_FILE

Path to the default CCD pickle file included in the AlphaFold 3 source code.

Internal Functions

_load_ccd_pickle_cached

Loads the CCD pickle file and caches it so that it is only loaded once. This is an internal function used by the Ccd class.