Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Private Member Functions
Bio.PDB.FragmentMapper.FragmentMapper Class Reference

List of all members.

Public Member Functions

def __init__
def has_key
def __contains__
def __getitem__

Public Attributes

 edge
 flength
 lsize
 reflist
 model
 fd

Private Member Functions

def _map

Detailed Description

Map polypeptides in a model to lists of representative fragments.

Definition at line 229 of file FragmentMapper.py.


Constructor & Destructor Documentation

def Bio.PDB.FragmentMapper.FragmentMapper.__init__ (   self,
  model,
  lsize = 20,
  flength = 5,
  fdir = "." 
)
@param model: the model that will be mapped
@type model: L{Model}

@param lsize: number of fragments in the library
@type lsize: int

@param flength: length of fragments in the library
@type flength: int

@param fdir: directory where the definition files are
    found (default=".")
@type fdir: string

Definition at line 233 of file FragmentMapper.py.

00233 
00234     def __init__(self, model, lsize=20, flength=5, fdir="."):
00235         """
00236         @param model: the model that will be mapped
00237         @type model: L{Model}
00238 
00239         @param lsize: number of fragments in the library
00240         @type lsize: int
00241 
00242         @param flength: length of fragments in the library
00243         @type flength: int
00244 
00245         @param fdir: directory where the definition files are
00246             found (default=".")
00247         @type fdir: string
00248         """
00249         if flength==5:
00250             self.edge=2
00251         elif flength==7:
00252             self.edge=3
00253         else:
00254             raise PDBException("Fragment length should be 5 or 7.")
00255         self.flength=flength
00256         self.lsize=lsize
00257         self.reflist=_read_fragments(lsize, flength, fdir)
00258         self.model=model
00259         self.fd=self._map(self.model)


Member Function Documentation

True if the given residue is in any of the mapped fragments.

@type res: L{Residue}

Definition at line 304 of file FragmentMapper.py.

00304 
00305     def __contains__(self, res):
00306         """True if the given residue is in any of the mapped fragments.
00307 
00308         @type res: L{Residue}
00309         """
00310         return (res in self.fd)

@type res: L{Residue}

@return: fragment classification
@rtype: L{Fragment}

Definition at line 311 of file FragmentMapper.py.

00311 
00312     def __getitem__(self, res):
00313         """
00314         @type res: L{Residue}
00315 
00316         @return: fragment classification
00317         @rtype: L{Fragment}
00318         """
00319         return self.fd[res]
00320 

Here is the caller graph for this function:

def Bio.PDB.FragmentMapper.FragmentMapper._map (   self,
  model 
) [private]
@param model: the model that will be mapped
@type model: L{Model}

Definition at line 260 of file FragmentMapper.py.

00260 
00261     def _map(self, model):
00262         """
00263         @param model: the model that will be mapped
00264         @type model: L{Model}
00265         """
00266         ppb=PPBuilder()
00267         ppl=ppb.build_peptides(model)
00268         fd={}
00269         for pp in ppl:
00270             try:
00271                 # make fragments
00272                 flist=_make_fragment_list(pp, self.flength)
00273                 # classify fragments
00274                 mflist=_map_fragment_list(flist, self.reflist)
00275                 for i in range(0, len(pp)):
00276                     res=pp[i]
00277                     if i<self.edge:
00278                         # start residues
00279                         continue
00280                     elif i>=(len(pp)-self.edge):
00281                         # end residues
00282                         continue
00283                     else:
00284                         # fragment
00285                         index=i-self.edge
00286                         assert(index>=0)
00287                         fd[res]=mflist[index]
00288             except PDBException, why:
00289                 if why == 'CHAINBREAK':
00290                     # Funny polypeptide - skip
00291                     pass
00292                 else:
00293                     raise PDBException(why)
00294         return fd

Here is the call graph for this function:

(Obsolete)

@type res: L{Residue}

Definition at line 295 of file FragmentMapper.py.

00295 
00296     def has_key(self, res):
00297         """(Obsolete)
00298 
00299         @type res: L{Residue}
00300         """
00301         import warnings
00302         warnings.warn("has_key is obsolete; use 'res in object' instead", PendingDeprecationWarning)
00303         return (res in self)


Member Data Documentation

Definition at line 249 of file FragmentMapper.py.

Definition at line 258 of file FragmentMapper.py.

Definition at line 254 of file FragmentMapper.py.

Definition at line 255 of file FragmentMapper.py.

Definition at line 257 of file FragmentMapper.py.

Definition at line 256 of file FragmentMapper.py.


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