openfold.data.mmcif_parsing¶
Parses the mmCIF file format.
Classes
|
|
|
Representation of a parsed mmCIF file. |
|
|
|
Returned by the parse function. |
|
|
|
Functions
|
|
|
Returns the oldest revision date. |
|
Extracts loop associated with a prefix from mmCIF data as a dictionary. |
|
Extracts loop associated with a prefix from mmCIF data as a list. |
|
Entry point, parses an mmcif_string. |
Exceptions
An error indicating that an mmCIF file could not be parsed. |
- class AtomSite(residue_name: str, author_chain_id: str, mmcif_chain_id: str, author_seq_num: str, mmcif_seq_num: int, insertion_code: str, hetatm_atom: str, model_num: int)¶
- Parameters:
- class MmcifObject(file_id, header, structure, chain_to_seqres, seqres_to_structure, raw_string)¶
Representation of a parsed mmCIF file.
- Contains:
- file_id: A meaningful name, e.g. a pdb_id. Should be unique amongst all
files being processed.
header: Biopython header. structure: Biopython structure. chain_to_seqres: Dict mapping chain_id to 1 letter amino acid sequence. E.g.
{‘A’: ‘ABCDEFG’}
- seqres_to_structure: Dict; for each chain_id contains a mapping between
- SEQRES index and a ResidueAtPosition. e.g. {‘A’: {0: ResidueAtPosition,
1: ResidueAtPosition, …}}
raw_string: The raw string used to construct the MmcifObject.
- Parameters:
- class ParsingResult(mmcif_object, errors)¶
Returned by the parse function.
- Contains:
- mmcif_object: A MmcifObject, may be None if no chain could be successfully
parsed.
errors: A dict mapping (file_id, chain_id) to any exception generated.
- mmcif_object: MmcifObject | None¶
- class ResidueAtPosition(position: ResiduePosition | None, name: str, is_missing: bool, hetflag: str)¶
- Parameters:
position (ResiduePosition | None)
name (str)
is_missing (bool)
hetflag (str)
- position: ResiduePosition | None¶
- get_atom_coords(mmcif_object, chain_id, _zero_center_positions=False)¶
- get_release_date(parsed_info)¶
Returns the oldest revision date.
- mmcif_loop_to_dict(prefix, index, parsed_info)¶
Extracts loop associated with a prefix from mmCIF data as a dictionary.
- Parameters:
prefix (str) – Prefix shared by each of the data items in the loop. e.g. ‘_entity_poly_seq.’, where the data items are _entity_poly_seq.num, _entity_poly_seq.mon_id. Should include the trailing period.
index (str) – Which item of loop data should serve as the key.
parsed_info (Mapping[str, Sequence[str]]) – A dict of parsed mmCIF data, e.g. _mmcif_dict from a Biopython parser.
- Returns:
Returns a dict of dicts; each dict represents 1 entry from an mmCIF loop, indexed by the index column.
- Return type:
- mmcif_loop_to_list(prefix, parsed_info)¶
Extracts loop associated with a prefix from mmCIF data as a list.
- Reference for loop_ in mmCIF:
http://mmcif.wwpdb.org/docs/tutorials/mechanics/pdbx-mmcif-syntax.html
- Parameters:
prefix (str) – Prefix shared by each of the data items in the loop. e.g. ‘_entity_poly_seq.’, where the data items are _entity_poly_seq.num, _entity_poly_seq.mon_id. Should include the trailing period.
parsed_info (Mapping[str, Sequence[str]]) – A dict of parsed mmCIF data, e.g. _mmcif_dict from a Biopython parser.
- Returns:
Returns a list of dicts; each dict represents 1 entry from an mmCIF loop.
- Return type:
- parse(*, file_id, mmcif_string, catch_all_errors=True)¶
Entry point, parses an mmcif_string.
- Parameters:
file_id (str) – A string identifier for this file. Should be unique within the collection of files being processed.
mmcif_string (str) – Contents of an mmCIF file.
catch_all_errors (bool) – If True, all exceptions are caught and error messages are returned as part of the ParsingResult. If False exceptions will be allowed to propagate.
- Returns:
A ParsingResult.
- Return type: