Table of Contents

Class: Entity Bio/PDB/Entity.py

Basic container object. Structure, Model, Chain and Residue are subclasses of Entity. It deals with storage and lookup.

Methods   
__delitem__
__getitem__
__init__
__len__
_sort
add
destroy
detach_child
detach_parent
get_full_id
get_id
get_list
get_parent
has_id
set_parent
sort
  __delitem__ 
__delitem__ ( self,  id )

Delete (and destroy) the child with given id.

  __getitem__ 
__getitem__ ( self,  id )

Return the child with given id.

  __init__ 
__init__ ( self,  id )

  __len__ 
__len__ ( self )

Return the number of children.

  _sort 
_sort (
        self,
        e1,
        e2,
        )

Sort the children in the Entity object.

This method is implemented by the Entity subclasses. A Chain object e.g. sorts Residue objects according to hetero field, sequence identifier and insertion code.

Exceptions   
NotImplementedError
  add 
add ( self,  entity )

Add a child to the Entity.

  destroy 
destroy ( self )

Destroy the Entity.

This trashes the Entity object and breaks all circular references (eh, yes, I'm still using 1.5).

  detach_child 
detach_child ( self,  id )

Remove (but do not destroy) a child.

  detach_parent 
detach_parent ( self )

Detach the parent.

  get_full_id 
get_full_id ( self )

Return the full id.

The full id is a tuple containing all id's starting from the top object (Structure) down to the current object. A full id for a Residue object e.g. is something like:

("1abc", 0, "A", (" ", 10, "A"))

This corresponds to:

Structure with id "1abc" Model with id 0 Chain with id "A" Residue with id (" ", 10, "A")

The Residue id indicates that the residue is not a hetero-residue (or a water) beacuse it has a blanc hetero field, that its sequence identifier is 10 and its insertion code "A".

  get_id 
get_id ( self )

Return the id.

  get_list 
get_list ( self )

Return the list of children.

  get_parent 
get_parent ( self )

Return the parent Entity object.

  has_id 
has_id ( self,  id )

Return 1 if a child with given id exists, otherwise 0.

  set_parent 
set_parent ( self,  entity )

Set the parent Entity object.

  sort 
sort ( self,  sort_function=None )

Sort the children in the Entity object.

Arguments: o sort_function - Optional. A function that compares two Entities. If this argument is present, the default sort method is replaced with this function.


Table of Contents

This document was automatically generated on Mon Jul 1 12:02:52 2002 by HappyDoc version 2.0.1