Package Bio :: Package PDB :: Module Chain :: Class Chain
[hide private]
[frames] | no frames]

Class Chain

source code

Entity.Entity --+
                |
               Chain

Instance Methods [hide private]
 
__init__(self, id) source code
 
_sort(self, r1, r2)
Sort function for residues in a chain
source code
 
_translate_id(self, id)
A residue id is normally a tuple (hetero flag, sequence identifier, insertion code).
source code
 
__getitem__(self, id)
Return the residue with given id.
source code
 
__delitem__(self, id)
Arguments: o id - (string, int, string) or int
source code
 
__repr__(self) source code
 
get_unpacked_list(self)
Return a list of undisordered residues.
source code
 
has_id(self, id)
Return 1 if a residue with given id is present.
source code
 
get_atoms(self) source code

Inherited from Entity.Entity: __iter__, __len__, add, detach_child, detach_parent, get_full_id, get_id, get_iterator, get_level, get_list, get_parent, set_parent

Method Details [hide private]

__init__(self, id)
(Constructor)

source code 
Overrides: Entity.Entity.__init__

_sort(self, r1, r2)

source code 

Sort function for residues in a chain

Residues are first sorted according to their hetatm records. Protein and nucleic acid residues first, hetatm residues next, and waters last. Within each group, the residues are sorted according to their resseq's (sequence identifiers). Finally, residues with the same resseq's are sorted according to icode.

Arguments: o r1, r2 - Residue objects

_translate_id(self, id)

source code 

A residue id is normally a tuple (hetero flag, sequence identifier, insertion code). Since for most residues the hetero flag and the insertion code are blank (i.e. " "), you can just use the sequence identifier to index a residue in a chain. The _translate_id method translates the sequence identifier to the (" ", sequence identifier, " ") tuple.

Arguments: o id - int, residue resseq

__getitem__(self, id)
(Indexing operator)

source code 

Return the residue with given id.

The id of a residue is (hetero flag, sequence identifier, insertion code). If id is an int, it is translated to (" ", id, " ") by the _translate_id method.

Arguments: o id - (string, int, string) or int

Overrides: Entity.Entity.__getitem__

__delitem__(self, id)
(Index deletion operator)

source code 

Arguments: o id - (string, int, string) or int

Overrides: Entity.Entity.__delitem__

get_unpacked_list(self)

source code 

Return a list of undisordered residues.

Some Residue objects hide several disordered residues (DisorderedResidue objects). This method unpacks them, ie. it returns a list of simple Residue objects.

has_id(self, id)

source code 
Return 1 if a residue with given id is present.

The id of a residue is (hetero flag, sequence identifier, insertion code).
        If id is an int, it is translated to (" ", id, " ") by the _translate_id
method.

Arguments:
o id - (string, int, string) or int

Overrides: Entity.Entity.has_id