STD_CCD_CACHE

openff.pablo.STD_CCD_CACHE: CcdCache

The CCD, with commonly-required patches for biomolecular simulation.

STD_CCD_CACHE is Pablo’s default residue library.

This attribute provides the CCD with a dict-like API. When a residue is requested via the indexing syntax (for example, STD_CCD_CACHE["ALA"]) or the in operator, a cache is checked first. If the residue is not present, the CCD is then checked. This requires internet access. If the residue cannot be retrieved from the cache or the CCD, a KeyError is raised or False is returned as appropriate.

Iterating over the cache, checking its length, or otherwise treating STD_CCD_CACHE as a mapping other than with the indexing syntax or in operator works only on the cache itself. As a result, accessing a residue via indexing may return a value even if these other methods suggest it won’t.

Several common residues are packaged with Pablo and never require an internet lookup. This includes the canonical amino and nucleic acids, water, several ions, and a few others. CCD entries that are downloaded are stored in $XDG_CACHE_HOME/openff-pablo/ccd_cache and are preserved between Python sessions. Pablo assumes that the files in the cache path were downloaded from the CCD and may do unexpected things if they are edited by hand, though deleting them is safe.

STD_CCD_CACHE also includes a number of patches for CCD entries that are known not to adhere to the high standards required for biomolecular simulation. New patches can be added with the with_patch() method.

The with_() and with_replaced methods allow custom definitions to be added to a new copy of STD_CCD_CACHE. These custom definitions are not patched. Since they are stored in the cache, custom definitions supercede any that have not already been downloaded from the CCD.

Accessing the CCD requires internet access. Without internet access, only entries packaged with Pablo or already in the cache can be loaded.

For details about the available methods, see the class documentation at openff.pablo.ccd.CcdCache