Package mmLib :: Module FileIO
[hide private]
[frames] | no frames]

Module FileIO

source code

Load and save mmLib.Structure objects from/to mmLib supported formats. The mmCIF and PDB file formats are currently supported.

Classes [hide private]
  FileIOUnsupportedFormat
  ZCat
Functions [hide private]
 
OpenFile(path, mode)
Right now this only supports opening GZip'ed files, in the future it might be extended for URLs.
source code
 
get_file_extension(path, default_extension='PDB')
Returns the 3-letter extension of the filename.
source code
 
get_file_arg(args) source code
 
open_fileobj(fil, file_mode) source code
 
LoadStructure(**args)
Loads a mmCIF file(.cif) or PDB file(.pdb) into a Structure class and returns it.
source code
 
SaveStructure(**args)
Saves a Structure object into a supported file type.
source code
 
test_module() source code
Variables [hide private]
  __package__ = 'mmLib'
Function Details [hide private]

LoadStructure(**args)

source code 

Loads a mmCIF file(.cif) or PDB file(.pdb) into a Structure class and returns it. The function takes 5 named arguments, one is required:

file = <file object or path; required> format = <'PDB'|'CIF'; defaults to 'PDB'> structure = <mmLib.Structure object to build on; defaults to creating new> sequence_from_structure = [True|False] <infer sequence from structure file, default False> library_bonds = [True|False] <build bonds from monomer library, default False> distance_bonds = [True|False] <build bonds from covalent distance calculations, default False>

SaveStructure(**args)

source code 

Saves a Structure object into a supported file type. file = <file object or path; required> structure = <mmLib.Structure object to save; required> format = <'PDB' or 'CIF'; defaults to 'PDB'>