Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Private Member Functions
Bio.PDB.Polypeptide.PPBuilder Class Reference
Inheritance diagram for Bio.PDB.Polypeptide.PPBuilder:
Inheritance graph
[legend]
Collaboration diagram for Bio.PDB.Polypeptide.PPBuilder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def build_peptides

Public Attributes

 radius

Private Member Functions

def _is_connected
def _test_dist

Detailed Description

Use C--N distance to find polypeptides.

Definition at line 398 of file Polypeptide.py.


Constructor & Destructor Documentation

def Bio.PDB.Polypeptide.PPBuilder.__init__ (   self,
  radius = 1.8 
)
@param radius: distance
@type radius: float

Reimplemented from Bio.PDB.Polypeptide._PPBuilder.

Definition at line 400 of file Polypeptide.py.

00400 
00401     def __init__(self, radius=1.8):
00402         _PPBuilder.__init__(self, radius)


Member Function Documentation

def Bio.PDB.Polypeptide.PPBuilder._is_connected (   self,
  prev_res,
  next_res 
) [private]

Definition at line 403 of file Polypeptide.py.

00403 
00404     def _is_connected(self, prev_res, next_res):
00405         if not prev_res.has_id("C"):
00406             return False
00407         if not next_res.has_id("N"):
00408             return False
00409         test_dist=self._test_dist
00410         c=prev_res["C"]
00411         n=next_res["N"]
00412         # Test all disordered atom positions!
00413         if c.is_disordered():
00414             clist=c.disordered_get_list()
00415         else:
00416             clist=[c]
00417         if n.is_disordered():
00418             nlist=n.disordered_get_list()
00419         else:
00420             nlist=[n]
00421         for nn in nlist:
00422             for cc in clist:
00423                 # To form a peptide bond, N and C must be 
00424                 # within radius and have the same altloc
00425                 # identifier or one altloc blank
00426                 n_altloc=nn.get_altloc()
00427                 c_altloc=cc.get_altloc()
00428                 if n_altloc==c_altloc or n_altloc==" " or c_altloc==" ": 
00429                     if test_dist(nn, cc):
00430                         # Select the disordered atoms that
00431                         # are indeed bonded
00432                         if c.is_disordered():
00433                             c.disordered_select(c_altloc)
00434                         if n.is_disordered():
00435                             n.disordered_select(n_altloc)
00436                         return True
00437         return False

Here is the call graph for this function:

Here is the caller graph for this function:

def Bio.PDB.Polypeptide.PPBuilder._test_dist (   self,
  c,
  n 
) [private]
Return 1 if distance between atoms<radius (PRIVATE).

Definition at line 438 of file Polypeptide.py.

00438 
00439     def _test_dist(self, c, n):
00440         """Return 1 if distance between atoms<radius (PRIVATE)."""
00441         if (c-n)<self.radius:
00442             return 1
00443         else:
00444             return 0
00445     

Here is the caller graph for this function:

def Bio.PDB.Polypeptide._PPBuilder.build_peptides (   self,
  entity,
  aa_only = 1 
) [inherited]
Build and return a list of Polypeptide objects.

@param entity: polypeptides are searched for in this object
@type entity: L{Structure}, L{Model} or L{Chain}

@param aa_only: if 1, the residue needs to be a standard AA
@type aa_only: int

Definition at line 321 of file Polypeptide.py.

00321 
00322     def build_peptides(self, entity, aa_only=1):
00323         """Build and return a list of Polypeptide objects.
00324 
00325         @param entity: polypeptides are searched for in this object
00326         @type entity: L{Structure}, L{Model} or L{Chain}
00327 
00328         @param aa_only: if 1, the residue needs to be a standard AA
00329         @type aa_only: int
00330         """
00331         is_connected=self._is_connected
00332         accept=self._accept
00333         level=entity.get_level()
00334         # Decide wich entity we are dealing with
00335         if level=="S":
00336             model=entity[0]
00337             chain_list=model.get_list()
00338         elif level=="M":
00339             chain_list=entity.get_list()
00340         elif level=="C":
00341             chain_list=[entity]
00342         else:
00343             raise PDBException("Entity should be Structure, Model or Chain.")
00344         pp_list=[]
00345         for chain in chain_list:
00346             chain_it=iter(chain)
00347             try:
00348                 prev_res = chain_it.next()
00349                 while not accept(prev_res, aa_only):
00350                     prev_res = chain_it.next()
00351             except StopIteration:
00352                 #No interesting residues at all in this chain
00353                 continue
00354             pp=None
00355             for next_res in chain_it:
00356                 if accept(prev_res, aa_only) \
00357                 and accept(next_res, aa_only) \
00358                 and is_connected(prev_res, next_res):
00359                     if pp is None:
00360                         pp=Polypeptide()
00361                         pp.append(prev_res)
00362                         pp_list.append(pp)
00363                     pp.append(next_res)
00364                 else:
00365                     #Either too far apart, or one of the residues is unwanted.
00366                     #End the current peptide
00367                     pp=None
00368                 prev_res=next_res
00369         return pp_list
00370 

Here is the call graph for this function:


Member Data Documentation

Definition at line 304 of file Polypeptide.py.


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