atomium.files.mmcif

Contains functions for dealing with the .mmcif file format.

atomium.files.mmcif.mmcif_string_to_mmcif_dict(filestring)[source]

Takes the filecontents of a .cif file and produces an atomium data dictionary from them.

Parameters:filestring (str) – The contents of a .cif file.
Return type:dict
atomium.files.mmcif.consolidate_strings(lines)[source]

In the .mmcif format, long strings are placed on a line of their own and marked with semi-colons. This function goes through the lines of such a file and creates new lines where these strings are on the preceding line where they semantically belong.

Parameters:lines (list) – The lines of a .mmcif file.
Return type:list
atomium.files.mmcif.mmcif_lines_to_mmcif_blocks(lines)[source]

Takes a list if .mmcif lines and groups them into blocks based on category name.

Parameters:lines (list) – The lines of a .mmcif file.
Return type:list
atomium.files.mmcif.category_block_to_dict(block)[source]

Takes a category block from a .mmcif file and turns it into a dictionary.

Parameters:block (dict) – The block to convert.
Return type:dict
atomium.files.mmcif.loop_block_to_list(block)[source]

Takes a loop block from a .mmcif file and turns it into a table list.

Parameters:block (dict) – The block to convert.
Return type:list
atomium.files.mmcif.split_values(line)[source]

Takes a line and splits it on strings, ignoring those in strings. Like shlex.split() only faster and it handles quotes inside strings.

Parameters:line (str) – The line to split.
Return type:list
atomium.files.mmcif.strip_quotes(mmcif_dict)[source]

Takes a finished mmcif dictionary, and trims any strings that have now unneeded quote marks around them.

Parameters:mmcif_dict (dict) – The dict to clean up.
atomium.files.mmcif.mmcif_dict_to_data_dict(mmcif_dict)[source]

Takes a basic .mmcif dict and turns it into a standard atomium data dictionary.

Parameters:mmcif_dict (dict) – The .mmcif dictionary.
Return type:dict
atomium.files.mmcif.update_description_dict(mmcif_dict, data_dict)[source]

Creates the description component of a standard atomium data dictionary from a .mmcif dictionary.

Parameters:
  • mmcif_dict (dict) – The .mmcif dictionary.
  • data_dict (dict) – The data dictionary to update.
atomium.files.mmcif.update_experiment_dict(mmcif_dict, data_dict)[source]

Creates the experiment component of a standard atomium data dictionary from a .mmcif dictionary.

Parameters:
  • mmcif_dict (dict) – The .mmcif dictionary.
  • data_dict (dict) – The data dictionary to update.
atomium.files.mmcif.update_quality_dict(mmcif_dict, data_dict)[source]

Creates the quality component of a standard atomium data dictionary from a .mmcif dictionary.

Parameters:
  • mmcif_dict (dict) – The .mmcif dictionary.
  • data_dict (dict) – The data dictionary to update.
atomium.files.mmcif.update_geometry_dict(mmcif_dict, data_dict)[source]

Creates the geometry component of a standard atomium data dictionary from a .mmcif dictionary.

Parameters:
  • mmcif_dict (dict) – The .mmcif dictionary.
  • data_dict (dict) – The data dictionary to update.
atomium.files.mmcif.update_models_list(mmcif_dict, data_dict)[source]

Creates the models component of a standard atomium data dictionary from a .mmcif dictionary.

Parameters:
  • mmcif_dict (dict) – The .mmcif dictionary.
  • data_dict (dict) – The data dictionary to update.
atomium.files.mmcif.assign_software_to_assembly(assembly, mmcif_dict)[source]

Takes an assembly dict, and goes through an mmcif dictionary looking for relevant software information to update it with.

Parameters:
  • assembly (dict) – The assembly to update.
  • mmcif_dict (dict) – The dictionary to read.
atomium.files.mmcif.assign_metrics_to_assembly(assembly, mmcif_dict)[source]

Takes an assembly dict, and goes through an mmcif dictionary looking for relevant energy etc. information to update it with.

Parameters:
  • assembly (dict) – The assembly to update.
  • mmcif_dict (dict) – The dictionary to read.
atomium.files.mmcif.assign_transformations_to_assembly(assembly, mmcif_dict)[source]

Takes an assembly dict, and goes through an mmcif dictionary looking for relevant transformation information to update it with.

Parameters:
  • assembly (dict) – The assembly to update.
  • mmcif_dict (dict) – The dictionary to read.
atomium.files.mmcif.get_transformation_ids(expression)[source]

Takes an operator expression from an .mmcif transformation dict, and works out what transformation IDs it is referring to.

Parameters:expression (str) – The expression to parse.
Return type:list
atomium.files.mmcif.atom_line_to_atom_dict(d)[source]

Takes an atom dictionary from an mmcif dictionary and turns it into an atomium atom dictionary.

Parameters:d (dict) – The mmcif atom dict.
Return type:dict