boltz_data.cif#
Parsing and handling of mmCIF files.
Functions
|
Parse an mmCIF block into a StructureDefinition. |
|
Convert a StructureDefinition to an mmCIF block. |
|
Read a CIF file containing multiple data blocks. |
|
Read a CIF file containing a single data block. |
|
Write a CIF document or block to a file. |
- boltz_data.cif.get_structure_from_mmcif(mmcif, /)[source]#
Parse an mmCIF block into a StructureDefinition.
Extracts entities (proteins, DNA, RNA, branched polymers, ligands), chains, and bond information from the mmCIF format.
- Parameters:
mmcif (
Block) – The mmCIF block to parse.- Return type:
StructureDefinition- Returns:
A StructureDefinition containing all entities, chains, and bonds.
- Raises:
ValueError – If no chains are found in the structure or if an unknown polymer type is encountered.
- boltz_data.cif.mmcif_from_structure(structure, /, *, name='pred')[source]#
Convert a StructureDefinition to an mmCIF block.
Creates mmCIF categories for entities, polymers, non-polymers, branched polymers, and their corresponding chains and numbering schemes.
- Parameters:
structure (
StructureDefinition) – The structure definition to convert.name (
str) – Name for the mmCIF data block. Defaults to “pred”.
- Return type:
Block- Returns:
An mmCIF block containing the structure information.
- boltz_data.cif.read_cif_from_file(path, /)[source]#
Read a CIF file containing multiple data blocks.
Supports local files, URLs, and cloud storage paths via smart_open.
- boltz_data.cif.read_single_cif_from_file(path, /)[source]#
Read a CIF file containing a single data block.
Supports local files, URLs, and cloud storage paths via smart_open.
- Parameters:
- Return type:
Block- Returns:
The single CIF block from the file.
- Raises:
ValueError – If the file contains multiple blocks.