pidibble.mmcif_parse module¶
- synopsis:
defines the MMCIF_Parser class for parsing mmCIF files
- class pidibble.mmcif_parse.MMCIFDict(data, linkers={}, blankers=[' ', '', '?'])[source]¶
Bases:
UserDictA dictionary-like class for handling mmCIF data with custom key resolution. This class extends UserDict to provide additional functionality for mmCIF data handling.
- Parameters:
- class pidibble.mmcif_parse.MMCIF_Parser(mmcif_formats, pdb_formats, cif_data)[source]¶
Bases:
objectA parser for mmCIF files, handling the parsing of various formats and structures.
- Parameters:
- gen_dict(mapspec)[source]¶
Generate a list of dictionaries based on the specified mapping specification. This method processes the mapping specification to create dictionaries that represent parsed records from the CIF data.
- Parameters:
mapspec (dict) – A dictionary containing the mapping specification, which includes keys like ‘data_obj’, ‘attr_map’, ‘splits’, ‘spawns_on’, ‘indexes’, ‘map_values’, ‘tables’, ‘spawn_data’, ‘global_maps’, ‘global_ids’, ‘list_attr’, ‘signal_attr’, ‘signal_value’, ‘allcaps’, and ‘if_dot_replace_with’.
- Returns:
A list of dictionaries representing the parsed records based on the mapping specification.
- Return type:
- parse()[source]¶
Parse the mmCIF data and generate a dictionary of
pdbrecord.PDBRecordinstances. This method processes the mmCIF formats and generates a dictionary where keys are record types and values are lists ofpdbrecord.PDBRecordinstances.- Returns:
A dictionary where keys are record types and values are lists of
pdbrecord.PDBRecordinstances.- Return type:
- update_ids(idmaps, cifrec, idx)[source]¶
Update the global IDs with values from the CIF record at a specific index.
- pidibble.mmcif_parse.rectify(val)[source]¶
Convert a value to its appropriate type, handling empty strings and special cases.
- Parameters:
val (str) – The value to be rectified, which can be a string representation of a number or an empty string.
- Returns:
The rectified value, which is an integer if the string represents a number, a float if it can be converted, or the original string if it cannot be converted.
- Return type:
- pidibble.mmcif_parse.resolve(key, aDict)[source]¶
Stub function to resolve a key in a dictionary. This function is a placeholder and does not perform any actual resolution.