Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.SCOP.Domain Class Reference
Inheritance diagram for Bio.SCOP.Domain:
Inheritance graph
[legend]
Collaboration diagram for Bio.SCOP.Domain:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __str__
def toDesRecord
def toClaRecord
def toHieRecord
def getChildren
def getParent
def getDescendents
def getAscendent

Public Attributes

 sid
 residues
 sunid
 parent
 children
 sccs
 type
 description
 scop

Detailed Description

A SCOP domain. A leaf node in the Scop hierarchy.

sid      -- The SCOP domain identifier. e.g. 'd5hbib_'

residues -- A Residue object. It defines the collection
              of PDB atoms that make up this domain.

Definition at line 632 of file __init__.py.


Constructor & Destructor Documentation

def Bio.SCOP.Domain.__init__ (   self,
  scop = None 
)
Create a Node in the scop hierarchy.  If a Scop instance is provided to the
constructor, this will be used to lookup related references using the SQL
methods.  If no instance is provided, it is assumed the whole tree exists
and is connected.

Reimplemented from Bio.SCOP.Node.

Definition at line 640 of file __init__.py.

00640 
00641     def __init__(self,scop=None):
00642         Node.__init__(self,scop=scop)
00643         self.sid = ''         
00644         self.residues = None


Member Function Documentation

def Bio.SCOP.Domain.__str__ (   self)

Reimplemented from Bio.SCOP.Node.

Definition at line 645 of file __init__.py.

00645 
00646     def __str__(self):
00647         s = []
00648         s.append(self.sid)
00649         s.append(self.sccs)
00650         s.append("("+str(self.residues)+")")
00651 
00652         if not self.getParent():
00653             s.append(self.description)
00654         else:
00655             sp = self.getParent()
00656             dm = sp.getParent()
00657             s.append(dm.description)
00658             s.append("{"+sp.description+"}")
00659 
00660         return " ".join(s)

Here is the call graph for this function:

def Bio.SCOP.Node.getAscendent (   self,
  node_type 
) [inherited]
Return the ancenstor node of the given type, or None.Node type can a
two letter code or longer description. e.g. 'fa' or 'family'

Definition at line 613 of file __init__.py.

00613 
00614     def getAscendent( self, node_type):
00615         """ Return the ancenstor node of the given type, or None.Node type can a
00616         two letter code or longer description. e.g. 'fa' or 'family'"""
00617         if node_type in _nodetype_to_code:
00618             node_type = _nodetype_to_code[node_type]
00619 
00620         if self.scop:
00621             return self.scop.getAscendentFromSQL(self,node_type)
00622         else:
00623             n = self
00624             if n.type == node_type: return None
00625             while n.type != node_type:
00626                 if n.type == 'ro': return None # Fell of the top of the hierarchy
00627                 n = n.getParent()            
00628                 
00629             return n
00630                                                             
00631     

def Bio.SCOP.Node.getChildren (   self) [inherited]
Return a list of children of this Node

Definition at line 578 of file __init__.py.

00578 
00579     def getChildren(self):
00580         """Return a list of children of this Node"""
00581         if self.scop is None:
00582             return self.children
00583         else:
00584             return map ( self.scop.getNodeBySunid, self.children )

Here is the caller graph for this function:

def Bio.SCOP.Node.getDescendents (   self,
  node_type 
) [inherited]
Return a list of all decendent nodes of the given type. Node type can a
two letter code or longer description. e.g. 'fa' or 'family'

Definition at line 592 of file __init__.py.

00592 
00593     def getDescendents( self, node_type):
00594         """ Return a list of all decendent nodes of the given type. Node type can a
00595         two letter code or longer description. e.g. 'fa' or 'family'
00596         """
00597         if node_type in _nodetype_to_code:
00598             node_type = _nodetype_to_code[node_type]
00599             
00600         nodes = [self]
00601         if self.scop:
00602             return self.scop.getDescendentsFromSQL(self,node_type)
00603         while nodes[0].type != node_type:
00604             if nodes[0].type == 'px' : return [] # Fell of the bottom of the hierarchy
00605             child_list = []
00606             for n in nodes:
00607                 for child in n.getChildren():
00608                     child_list.append( child )
00609                 nodes = child_list
00610                 
00611         return nodes
00612                     

def Bio.SCOP.Node.getParent (   self) [inherited]
Return the parent of this Node

Definition at line 585 of file __init__.py.

00585 
00586     def getParent(self):
00587         """Return the parent of this Node"""
00588         if self.scop is None:
00589             return self.parent
00590         else:
00591             return self.scop.getNodeBySunid( self.parent )

Here is the caller graph for this function:

Return a Cla.Record

Definition at line 667 of file __init__.py.

00667 
00668     def toClaRecord(self):
00669         """Return a Cla.Record"""        
00670         rec = Cla.Record()
00671         rec.sid = self.sid
00672         rec.residues = self.residues
00673         rec.sccs = self.sccs
00674         rec.sunid = self.sunid
00675         
00676         n = self
00677         while n.sunid != 0: #Not root node
00678             rec.hierarchy[n.type] = str(n.sunid)
00679             n = n.getParent()
00680 
00681         # Order does not matter in the hierarchy field. For more info, see
00682         # http://scop.mrc-lmb.cam.ac.uk/scop/release-notes.html
00683         #rec.hierarchy.reverse()
00684        
00685         return rec
            
Return a Des.Record

Reimplemented from Bio.SCOP.Node.

Definition at line 661 of file __init__.py.

00661 
00662     def toDesRecord(self):
00663         """Return a Des.Record"""
00664         rec = Node.toDesRecord(self)
00665         rec.name = self.sid
00666         return rec

def Bio.SCOP.Node.toHieRecord (   self) [inherited]
Return an Hie.Record

Definition at line 557 of file __init__.py.

00557 
00558     def toHieRecord(self):
00559         """Return an Hie.Record"""
00560         rec = Hie.Record()
00561         rec.sunid = str(self.sunid)
00562         if self.getParent() : #Not root node
00563             rec.parent = str(self.getParent().sunid)
00564         else:
00565             rec.parent = '-'
00566         for c in self.getChildren():
00567             rec.children.append(str(c.sunid))
00568         return rec
    

Here is the call graph for this function:


Member Data Documentation

Definition at line 542 of file __init__.py.

Definition at line 545 of file __init__.py.

Bio.SCOP.Node.parent [inherited]

Definition at line 541 of file __init__.py.

Definition at line 643 of file __init__.py.

Bio.SCOP.Node.sccs [inherited]

Definition at line 543 of file __init__.py.

Bio.SCOP.Node.scop [inherited]

Definition at line 546 of file __init__.py.

Definition at line 642 of file __init__.py.

Bio.SCOP.Node.sunid [inherited]

Definition at line 540 of file __init__.py.

Bio.SCOP.Node.type [inherited]

Definition at line 544 of file __init__.py.


The documentation for this class was generated from the following file: