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

Class Structure

source code

object --+
         |
        Structure

The Structure object is the parent container object for the entire macromolecular data structure. It contains a list of the Chain objects in the structure hierarchy, and contains these additional data objects:

cifdb(mmLib.mmCIFDB) A mmCIF database with additional structure data.

unit_cell(mmLib.UnitCell) Unit cell/Spacegroup for the structure.

default_alt_loc(string) The default alternate location identifier used when iterating or retreiving Atom objects in the structure.

Instance Methods [hide private]
 
__init__(self, **args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
__deepcopy__(self, memo) source code
 
__len__(self)
Returns the number of stored Chain objects.
source code
 
__getitem__(self, chain_idx)
Same as get_chain, but raises KeyError if the requested chain_id is not found.
source code
 
__iter__(self)
Iterates the Chain objects in the Structure.
source code
 
__contains__(self, model_chain_idx)
Returns True if item is a Model in the Structure, or a Chain or chain_id in the default Model.
source code
 
index(self, model_chain)
If item is a Model, returns the index of the Model in the Structure, or if the item is a Chain, returns the index of the Chain in the default Model.
source code
 
sort(self)
Sorts all Models and Chains in the Structure according to standard model_id, chain_id, and fragment_id sorting rules.
source code
 
add_model(self, model, delay_sort=True)
Adds a Model to a Structure.
source code
 
remove_model(self, model)
Removes a child Model object.
source code
 
get_model(self, model_id)
Return the Model object with the argument model_id, or None if not found.
source code
 
get_default_model(self)
Returns the default Model object.
source code
 
set_default_model(self, model_id)
Sets the default Model for the Structure to model_id.
source code
 
set_model(self, model_id)
DEP: Use set_default_model() Sets the default Model for the Structure to model_id.
source code
 
iter_models(self)
Iterates over all Model objects.
source code
 
count_models(self)
Counts all Model objects in the Structure.
source code
 
add_chain(self, chain, delay_sort=True)
Adds a Chain object to the Structure.
source code
 
remove_chain(self, chain)
Removes a Chain object.
source code
 
get_chain(self, chain_id)
Returns the Chain object matching the chain_id character.
source code
 
count_chains(self)
Counts all Chain objects in the default Model.
source code
 
iter_chains(self)
Iterates over all Chain objects in the default Model, in alphabetical order according to their chain_id.
source code
 
iter_all_chains(self)
Iterates over all Chain objects in all Model objects.
source code
 
add_fragment(self, fragment, delay_sort=True)
Adds a Fragment object.
source code
 
remove_fragment(self, fragment)
Removes a Fragment object.
source code
 
count_fragments(self)
Counts all Fragment objects in the default Model.
source code
 
iter_fragments(self)
Iterates over all Fragment objects in the default Model.
source code
 
iter_all_fragments(self)
Iterates over all Fragment objects in all Models.
source code
 
has_amino_acids(self)
Returns True if there are AminoAcidResidue objects in the default Model of the Structure.
source code
 
count_amino_acids(self)
Counts all AminoAcidResidue objects in the default Model.
source code
 
iter_amino_acids(self)
Same as iter_fragments() but only iterates over Fragments of the subclass AminoAcidResidue.
source code
 
iter_all_amino_acids(self)
Iterates over all AminoAcidResidue objects in all Models.
source code
 
has_nucleic_acids(self)
Returns True if the Structure contains NucleicAcidResiudes in the default Model.
source code
 
count_nucleic_acids(self)
Counts all NucleicAcidResidue objects in the default Model.
source code
 
iter_nucleic_acids(self)
Same as iter_fragments() but only iterates over Fragments of the subclass NucleicAcidResidue.
source code
 
iter_all_nucleic_acids(self)
Iterates over all NucleicAcidResidue objects in all Models.
source code
 
has_standard_residues(self)
Returns True if the Structure contains amino or nucleic acids in the default Model.
source code
 
count_standard_residues(self)
Counts the number of standard residues in the default Model.
source code
 
iter_standard_residues(self)
Iterates over standard residues in the default Model.
source code
 
has_non_standard_residues(self)
Returns True if there are non-standard residues in the default Model.
source code
 
count_non_standard_residues(self)
Counts all non-standard residues in the default Model.
source code
 
iter_non_standard_residues(self)
Iterates over non-standard residues in the default Model.
source code
 
has_waters(self)
Returns True if there are waters in the default Model.
source code
 
count_waters(self)
Counts all waters in the default Model.
source code
 
iter_waters(self)
Iterate over all waters in the default Model.
source code
 
add_atom(self, atom, delay_sort=False)
Adds an Atom object to the Structure.
source code
 
remove_atom(self, atom)
Removes an Atom.
source code
 
iter_atoms(self)
Iterates over all Atom objects in the default Model, using the default alt_loc.
source code
 
count_atoms(self)
Counts all Atom objects in the default Model using the default alt_loc.
source code
 
iter_all_atoms(self)
Iterates over all Atom objects in the Structure.
source code
 
count_all_atoms(self)
Counts all atoms in the default Model using the default alt_loc.
source code
 
get_equivalent_atom(self, atom)
Returns the atom with the same fragment_id and name as the argument atom, or None if it is not found.
source code
 
iter_bonds(self)
Iterates over all Bond objects.
source code
 
count_bonds(self)
Counts all Bond objects using the default Model and default alt_loc.
source code
 
alt_loc_list(self)
Return the unique list of Atom alternate location IDs found in the Structure.
source code
 
add_alpha_helix(self, alpha_helix)
Adds an AlphaHelix to the default Model object.
source code
 
iter_alpha_helicies(self)
Iterates over all child AlphaHelix objects in the default Model.
source code
 
add_beta_sheet(self, beta_sheet)
Adds a BetaSheet to the default Model object.
source code
 
iter_beta_sheets(self)
Iterate over all beta sheets in the Structure.
source code
 
add_site(self, site)
Adds a Site object to the default Model.
source code
 
iter_sites(self)
Iterate over all active/important sites defined in the Structure.
source code
 
get_structure(self)
Returns self.
source code
 
get_default_alt_loc(self)
Returns the default alt_loc string.
source code
 
set_default_alt_loc(self, alt_loc)
Sets the default alt_loc for the Stucture.
source code
 
add_bonds_from_covalent_distance(self)
Builds a Structure's bonds by atomic distance distance using the covalent radii in element.cif.
source code
 
add_bonds_from_library(self)
Builds bonds for all Fragments in the Structure from bond tables for monomers retrieved from the Library implementation of the Structure.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **args)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

add_model(self, model, delay_sort=True)

source code 

Adds a Model to a Structure. Raises the ModelOverwrite exception if the model_id of the Model matches the model_id of a Model already in the Structure. If there are no Models in the Structure, the Model is used as the default Model.

remove_model(self, model)

source code 

Removes a child Model object. If the Model object is the default Model, then choose the Model with the lowest model_id as the new default Model, or None if there are no more Models.

set_default_model(self, model_id)

source code 

Sets the default Model for the Structure to model_id. Returns False if a Model with the proper model_id does not exist in the Structure.

set_model(self, model_id)

source code 

DEP: Use set_default_model() Sets the default Model for the Structure to model_id. Returns False if a Model with the proper model_id does not exist in the Structure.

add_chain(self, chain, delay_sort=True)

source code 

Adds a Chain object to the Structure. Creates necessary parent Model if necessary.

iter_fragments(self)

source code 

Iterates over all Fragment objects in the default Model. The iteration is performed in order according the the parent Chain's chain_id, and the Fragment's position within the chain.

iter_all_fragments(self)

source code 

Iterates over all Fragment objects in all Models. The iteration is performed in order according the the parent Chain's chain_id, and the Fragment's position within the chain.

iter_non_standard_residues(self)

source code 

Iterates over non-standard residues in the default Model. Non-standard residues are any Fragments which are not an amino or nucleic acid.

add_atom(self, atom, delay_sort=False)

source code 

Adds an Atom object to the Structure. If a collision occurs, an error is raised.

iter_atoms(self)

source code 

Iterates over all Atom objects in the default Model, using the default alt_loc. The iteration is preformed in order according to the Chain and Fragment ordering rules the Atom object is a part of.

iter_all_atoms(self)

source code 

Iterates over all Atom objects in the Structure. The iteration is performed according to common PDB ordering rules, over all Models and all alternate conformations.

iter_bonds(self)

source code 

Iterates over all Bond objects. The iteration is preformed by iterating over all Atom objects in the same order as iter_atoms(), then iterating over each Atom's Bond objects.

add_bonds_from_covalent_distance(self)

source code 

Builds a Structure's bonds by atomic distance distance using the covalent radii in element.cif. A bond is built if the the distance between them is less than or equal to the sum of their covalent radii + 0.54A.