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

Class Segment

source code

object --+
         |
        Segment
Known Subclasses:

Segment objects are a container for Fragment objects, but are disassociated with the Structure object hierarch. Chain objects are a subclass of Segment objects which are part of the Structure hierarchy.

Instance Methods [hide private]
 
__init__(self, model_id=1, chain_id='', **args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
__deepcopy__(self, memo)
Implements copy module protocol for deepcopy() operation.
source code
 
__lt__(self, other)
Less than operator based on the chain_id.
source code
 
__le__(self, other)
Less than or equal operator based on chain_id.
source code
 
__gt__(self, other)
Greator than operator based on chain_id.
source code
 
__ge__(self, other)
Greator than or equal to operator based on chain_id.
source code
 
__len__(self)
Return the number of Fragments in the Segment.
source code
 
__getitem__(self, fragment_idx)
Retrieve a Fragment within the Segment.
source code
 
__iter__(self)
Iterate all Fragments contained in the Segment.
source code
 
__contains__(self, fragment_idx)
Checks for Fragment objects, or the fragment_id string.
source code
 
index(self, fragment)
Return the 0-based index of the fragment in the segment list.
source code
 
sort(self)
Sort the Fragments in the Segment into proper order.
source code
 
construct_segment(self)
Constructs a new Segment object so that it has a valid .chain reference.
source code
 
construct_sub_segment(self, start_frag_id, stop_frag_id)
Construct and return a sub-Segment between start_frag_id and stop_frag_id.
source code
 
add_fragment(self, fragment, delay_sort=False)
Adds a Fragment instance to the Segment.
source code
 
remove_fragment(self, fragment)
Removes a Fragment object from the Segment.
source code
 
get_fragment(self, fragment_id)
Returns the PDB fragment uniquely identified by its fragment_id.
source code
 
iter_fragments(self, frag_id_begin=None, frag_id_end=None)
Iterates over all Fragment objects.
source code
 
count_fragments(self)
Return the number of Fragment objects.
source code
 
has_amino_acids(self) source code
 
count_amino_acids(self) source code
 
iter_amino_acids(self) source code
 
has_nucleic_acids(self) source code
 
count_nucleic_acids(self) source code
 
iter_nucleic_acids(self) source code
 
has_standard_residues(self) source code
 
count_standard_residues(self) source code
 
iter_standard_residues(self) source code
 
has_non_standard_residues(self) source code
 
count_non_standard_residues(self) source code
 
iter_non_standard_residues(self) source code
 
has_waters(self) source code
 
count_waters(self) source code
 
iter_waters(self) source code
 
add_atom(self, atom, delay_sort=False)
Adds an Atom.
source code
 
remove_atom(self, atom)
Removes an Atom object.
source code
 
iter_atoms(self)
Iterates over all Atom objects within the Segment using the default conformation set in the parent Structure.
source code
 
count_atoms(self) source code
 
iter_all_atoms(self)
Performs an in-order iteration of all atoms in the Segment, including alternate conformations.
source code
 
count_all_atoms(self) 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 attached to Atom objects within the Segment.
source code
 
get_chain(self)
Returns the Chain object this Segment is part of.
source code
 
get_model(self)
Returns the parent Model object.
source code
 
get_structure(self)
Returns the parent Structure object.
source code
 
set_model_id(self, model_id)
Sets the model_id of all contained objects.
source code
 
set_chain_id(self, chain_id)
Sets the model_id of all contained objects.
source code
 
is_homolog(self, segment2)
Returns True if there are no disagreements in the sequences of this segment and segment2.
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, model_id=1, chain_id='', **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)

__getitem__(self, fragment_idx)
(Indexing operator)

source code 

Retrieve a Fragment within the Segment. This can take an integer index of the Fragment's position within the segment, the fragment_id string of the Fragment to retrieve, or a slice of the Segment to return a new Segment object containing the sliced subset of Fragments. If the slice values are fragment_id strings, then the Segment which is returned includes those Fragments. If the slice values are integers, then normal list slicing rules apply.

construct_sub_segment(self, start_frag_id, stop_frag_id)

source code 

Construct and return a sub-Segment between start_frag_id and stop_frag_id. If start_frag_id is None, then the slice is taken from the beginning of this Segment, and if stop_frag_id is None it is taken to the end of this Segment.

add_fragment(self, fragment, delay_sort=False)

source code 

Adds a Fragment instance to the Segment. If delay_sort is True, then the fragment is not inserted in the proper position within the segment.

iter_fragments(self, frag_id_begin=None, frag_id_end=None)

source code 

Iterates over all Fragment objects. The iteration is performed in order according to the Fragment's position within the Segment object.