Back to index

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

List of all members.

Public Member Functions

def __init__
def build_peptides

Public Attributes

 radius

Private Member Functions

def _is_connected

Detailed Description

Use CA--CA distance to find polypeptides.

Definition at line 371 of file Polypeptide.py.


Constructor & Destructor Documentation

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

Reimplemented from Bio.PDB.Polypeptide._PPBuilder.

Definition at line 373 of file Polypeptide.py.

00373 
00374     def __init__(self, radius=4.3):
00375         _PPBuilder.__init__(self, radius)


Member Function Documentation

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

Definition at line 376 of file Polypeptide.py.

00376 
00377     def _is_connected(self, prev_res, next_res):
00378         for r in [prev_res, next_res]:
00379             if not r.has_id("CA"):
00380                 return False
00381         n=next_res["CA"]
00382         p=prev_res["CA"]
00383         # Unpack disordered
00384         if n.is_disordered():
00385             nlist=n.disordered_get_list()
00386         else:
00387             nlist=[n]
00388         if p.is_disordered():
00389             plist=p.disordered_get_list()
00390         else:
00391             plist=[p]
00392         for nn in nlist:
00393             for pp in plist:
00394                 if (nn-pp)<self.radius:
00395                     return True
00396         return False
00397 

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: