Package mmLib :: Module StructureBuilder :: Class StructureBuilder
[hide private]
[frames] | no frames]

Class StructureBuilder

source code

object --+
         |
        StructureBuilder
Known Subclasses:

Builder class for the mmLib.Structure object hierarchy. StructureBuilder must be subclassed with a working parse_format() method to implement a working builder.

Instance Methods [hide private]
 
__init__(self, sequence_from_structure=False, library_bonds=False, distance_bonds=False, auto_sort=True, **args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
read_start(self, fil)
This methods needs to be reimplemented in a functional subclass.
source code
 
read_start_finalize(self)
Called after the read_start method.
source code
 
read_atoms(self)
This method needs to be reimplemented in a functional subclass.
source code
 
load_atom(self, atm_map)
Called repeatedly by the implementation of read_atoms to load all the data for a single atom.
source code
 
name_service(self)
Runs the name service on all atoms needing to be named.
source code
 
read_atoms_finalize(self)
After loading all atom records, use the list of atom records to build the structure.
source code
 
read_metadata(self)
This method needs to be reimplemented in a functional subclass.
source code
 
load_structure_id(self, structure_id) source code
 
load_unit_cell(self, ucell_map)
Called by the implementation of load_metadata to load the unit cell parameters for the structure.
source code
 
load_bonds(self, bond_map)
Call by the implementation of load_metadata to load bond information on the structure.
source code
 
load_sequence(self, sequence_map)
The sequence map contains the following keys: chain_id: the chain ID fo the sequence; num_res: the number of residues in the sequence; sequence_list: a list of 3-letter codes of the residues in the sequence.
source code
 
load_alpha_helicies(self, helix_list)
The argument helix_list is a list of Python dictionaries with information to build build AlphaHelix objects into the Structure.
source code
 
load_beta_sheets(self, beta_sheet_list)
The argument beta_sheet_list is a list of Python dictionaries with information to build build BetaSheet objects into the Structure.
source code
 
load_sites(self, site_list)
The argument site_list is a list of Python dictionaries with information to build build Site objects into the Structure.
source code
 
read_metadata_finalize(self)
Called after the the metadata loading is complete.
source code
 
read_end(self)
This method needs to be reimplemented in a functional subclass.
source code
 
read_end_finalize(self)
Called for final cleanup after structure source reading is done.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sequence_from_structure=False, library_bonds=False, distance_bonds=False, auto_sort=True, **args)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

read_start(self, fil)

source code 

This methods needs to be reimplemented in a functional subclass. This function is called with the file object (or any other object passed in to build a Structure from) to begin the reading process. This is usually used to open the source file.

read_start_finalize(self)

source code 

Called after the read_start method. Does nothing currently, but may be used in the future.

read_atoms(self)

source code 

This method needs to be reimplemented in a functional subclass. The subclassed read_atoms method should call load_atom once for every atom in the structure, and should not call any other load_* methods.

load_atom(self, atm_map)

source code 

Called repeatedly by the implementation of read_atoms to load all the data for a single atom. The data is contained in the atm_map argument, and is not well documented at this point. Look at this function and you'll figure it out.

name_service(self)

source code 

Runs the name service on all atoms needing to be named. This is a complicated function which corrects most commonly found errors and omissions from PDB files.

read_metadata(self)

source code 

This method needs to be reimplemented in a functional subclass. The subclassed read_metadata method should call the various load_* methods to set non-atom coordinate data for the Structure.

load_bonds(self, bond_map)

source code 
Call by the implementation of load_metadata to load bond 
information on the structure. The keys of the bond map are a 2-tuple
of the bonded Atom instances, and the value is a dictionary
containing information on the type of bond, which may also
be a symmetry operator.

[bond_map]
keys: (atm1, atm2)
values: bond_data_map(s)

[bond_data_map]
bond_type -> text description of bond type: covalent, salt bridge,
             hydrogen, cispeptide

atm1_symop -> symmetry operation (if any) to be applied to atm1
atm2_symop -> same as above, for atom 2

The symmetry operations themselves are a 3x4 array of floating point
values composed of the 3x3 rotation matrix and the 3x1 translation.

load_alpha_helicies(self, helix_list)

source code 
The argument helix_list is a list of Python dictionaries with
information to build build AlphaHelix objects into the Structure.

The dictionary has attributes:
    helix_id:    The ID of the helix
    chain_id:    The chain_id where the helix is located
    frag_id1:    The start fragment_id of the helix
    frag_id2:    The end fragment_id of the helix
    helix_class: The PDB helix class number
    detaisl:     Text commont about the helix

load_beta_sheets(self, beta_sheet_list)

source code 
The argument beta_sheet_list is a list of Python dictionaries with
information to build build BetaSheet objects into the Structure.

The dictionary has attributes:
    sheet_id:    ID of the sheet
    num_strands: total number of strands in the beta sheet
    strand_list: list of dictionaries describing the strand with
                 the following attributes:

        chain_id1/frag_id1: chain_id and fragment_id of inital residue
                            in the strand
        chain_id2/frag_id2: chain_id and fragment_id of end residue
                            in the strand
        sense:              the sense of the strand with respect to the
                            previous strand, either the string
                            parallel or anti_parallel

        reg_chain_id, reg_frag_id, reg_atom:
                            registration atom in current strand
        reg_prev_chain_id, reg_prev_frag_id, reg_prev_atom:
                            registration atom in previous strand

read_end(self)

source code 

This method needs to be reimplemented in a functional subclass. The subclassed read_end method can be used for any clean up from the file loading process you need, or may be left unimplemented.

read_end_finalize(self)

source code 

Called for final cleanup after structure source reading is done. Currently, this method does nothing but may be used in future versions.