atomium.files.pdb

Contains functions for dealing with the .pdb file format.

atomium.files.pdb.pdb_string_to_pdb_dict(filestring)[source]

Takes the filecontents of a .pdb file and produces an pdb file dictionary from them.

Parameters:filestring (str) – The contents of a .pdb file.
Return type:dict
atomium.files.pdb.pdb_dict_to_data_dict(pdb_dict)[source]

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

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

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

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

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

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

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

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

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

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

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

Parameters:
  • pdb_dict (dict) – The .pdb dictionary to update.
  • data_dict (dict) – The data dictionary to update.
atomium.files.pdb.extract_header(pdb_dict, description_dict)[source]

Takes a dict and adds header information to it by parsing the HEADER line.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • description_dict (dict) – the dict to update.
atomium.files.pdb.extract_title(pdb_dict, description_dict)[source]

Takes a dict and adds title information to it by parsing TITLE lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • description_dict (dict) – the dict to update.
atomium.files.pdb.extract_keywords(pdb_dict, description_dict)[source]

Takes a dict and adds keyword information to it by parsing KEYWD lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • description_dict (dict) – the dict to update.
atomium.files.pdb.extract_authors(pdb_dict, description_dict)[source]

Takes a dict and adds author information to it by parsing AUTHOR lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • description_dict (dict) – the dict to update.
atomium.files.pdb.extract_technique(pdb_dict, experiment_dict)[source]

Takes a dict and adds technique information to it by parsing EXPDTA lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • experiment_dict (dict) – the dict to update.
atomium.files.pdb.extract_source(pdb_dict, experiment_dict)[source]

Takes a dict and adds source information to it by parsing SOURCE lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • experiment_dict (dict) – the dict to update.
atomium.files.pdb.extract_resolution_remark(pdb_dict, quality_dict)[source]

Takes a dict and adds resolution information to it by parsing REMARK 2 lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • quality_dict (dict) – the dict to update.
atomium.files.pdb.extract_rvalue_remark(pdb_dict, quality_dict)[source]

Takes a dict and adds resolution information to it by parsing REMARK 3 lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • quality_dict (dict) – the dict to update.
atomium.files.pdb.extract_assembly_remark(pdb_dict, geometry_dict)[source]

Takes a dict and adds assembly information to it by parsing REMARK 350 lines.

Parameters:
  • pdb_dict (dict) – the dict to read.
  • geometry_dict (dict) – the dict to update.
atomium.files.pdb.assembly_lines_to_assembly_dict(lines)[source]

Takes the lines representing a single biological assembly and turns them into an assembly dictionary.

Parameters:lines (list) – The REMARK lines to read.
Return type:dict
atomium.files.pdb.atom_line_to_atom_dict(line, polymer=True)[source]

Takes an ATOM or HETATM line and converts it to an atom dict.

Parameters:
  • line (str) – the atom record to parse.
  • polymer (bool) – is this atom in a chain or not?
Return type:

dict

atomium.files.pdb.assign_anisou(model_dict, model)[source]

Aassigns anisotropy information the atoms in a model dictionary, by pasrsing ANISOU lines.

Parameters:
  • pdb_dict (dict) – The dict to read.
  • model_list (list) – The list of model dictionaries to update.
atomium.files.pdb.extract_sequence(pdb_dict, model_list)[source]

Adds sequence information to the chains of each model in a list of model dictionaries, by parsing SEQRES lines.

Parameters:
  • pdb_dict (dict) – The dict to read from.
  • model_list (list) – The list of model dictionaries to update.
atomium.files.pdb.extract_connections(pdb_dict, model_list)[source]

Adds connectivity information to each model in a list of model dictionaries, by parsing CONECT lines.

Parameters:
  • pdb_dict (dict) – The dict to read from.
  • model_list (list) – The list of model dictionaries to update.
atomium.files.pdb.merge_lines(lines, start, join=' ')[source]

Gets a single continuous string from a sequence of lines.

Parameters:
  • lines (list) – The lines to merge.
  • start (int) – The start point in each record.
  • join (str) – The string to join on.
Return type:

str

atomium.files.pdb.file_to_pdb_string(file)[source]

Takes a File and turns it into a .pdb filestring that represents it.

Parameters:file (File) – the File to convert.
Return type:str
atomium.files.pdb.pack_annotation(file, lines)[source]

Adds non-structural records to a list of lines.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_structure(file, lines)[source]

Adds structural records to a list of lines.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_header(file, lines)[source]

Adds a HEADER record to a list of lines.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_title(file, lines)[source]

Adds TITLE records to a list of lines.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_resolution(file, lines)[source]

Adds REMARK records to a list of lines for resolution.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_rvalue(file, lines)[source]

Adds REMARK records to a list of lines for rvalue.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_source(file, lines)[source]

Adds SOURCE records to a list of lines for source organism and expression system.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_technique(file, lines)[source]

Adds a EXPDTA record to a list of lines for experimental technique. :param list lines: The record lines to add to.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_keywords(file, lines)[source]

Adds a KEYWDS record to a list of lines for PDB keyword tags.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_sequences(file, lines)[source]

Adds SEQRES records to a list of lines for sequence annotation.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.pack_assemblies(file, lines)[source]

Adds REMARK 350 records to a list of lines for assembly annotation.

Parameters:
  • file (File) – The File to read.
  • lines (list) – The record lines to add to.
atomium.files.pdb.atom_to_atom_line(a, lines)[source]

Converts an Atom to an ATOM or HETATM record and adds it to a list of lines. ANISOU records will also be made.

Parameters:
  • a (Atom) – The Atom to pack.
  • l (list) – The lines to add to.
atomium.files.pdb.atom_to_anisou_line(a, name, res_name, chain_id, res_id, insert)[source]

Converts an Atom to an ANISOU record.

Parameters:
  • a (Atom) – The Atom to pack.
  • name (str) – The atom name to use.
  • res_name (str) – The residue name to use.
  • chain_id (str) – The chain ID to use.
  • res_id (str) – The residue ID to use.
  • insert (str) – The residue insert code to use.
Return type:

str

atomium.files.pdb.pack_connections(structure, lines)[source]

Adds CONECT records to a list of lines.

Parameters:
atomium.files.pdb.split_string(string, record, start)[source]

Takes a string and splits it into multple PDB records, with number continuation lines.

Parameters:
  • string (str) – The string to split.
  • record (str) – The record name.
  • start (int) – The position to start the string at on each line.