Back to index

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

List of all members.

Public Member Functions

def __init__
def get_resname_list
def get_id
def get_coords
def add_residue
def __len__
def __sub__
def __repr__

Public Attributes

 length
 counter
 resname_list
 coords_ca
 fid

Detailed Description

Represent a polypeptide C-alpha fragment.

Definition at line 89 of file FragmentMapper.py.


Constructor & Destructor Documentation

def Bio.PDB.FragmentMapper.Fragment.__init__ (   self,
  length,
  fid 
)
@param length: length of the fragment
@type length: int

@param fid: id for the fragment
@type fid: int

Definition at line 93 of file FragmentMapper.py.

00093 
00094     def __init__(self, length, fid):
00095         """
00096         @param length: length of the fragment
00097         @type length: int
00098 
00099         @param fid: id for the fragment
00100         @type fid: int
00101         """
00102         # nr of residues in fragment
00103         self.length=length
00104         # nr of residues added
00105         self.counter=0
00106         self.resname_list=[]
00107         # CA coordinate matrix
00108         self.coords_ca=numpy.zeros((length, 3), "d")
00109         self.fid=fid


Member Function Documentation

@return: length of fragment
@rtype: int

Definition at line 145 of file FragmentMapper.py.

00145 
00146     def __len__(self):
00147         """
00148         @return: length of fragment
00149         @rtype: int
00150         """
00151         return self.length

Returns <Fragment length=L id=ID> where L=length of fragment
and ID the identifier (rank in the library).

Definition at line 167 of file FragmentMapper.py.

00167 
00168     def __repr__(self):
00169         """
00170         Returns <Fragment length=L id=ID> where L=length of fragment
00171         and ID the identifier (rank in the library).
00172         """
00173         return "<Fragment length=%i id=%i>" % (self.length, self.fid)
00174 

def Bio.PDB.FragmentMapper.Fragment.__sub__ (   self,
  other 
)
Return rmsd between two fragments.

Example:
    >>> rmsd=fragment1-fragment2

@return: rmsd between fragments
@rtype: float

Definition at line 152 of file FragmentMapper.py.

00152 
00153     def __sub__(self, other):
00154         """
00155         Return rmsd between two fragments.
00156 
00157         Example:
00158             >>> rmsd=fragment1-fragment2
00159 
00160         @return: rmsd between fragments
00161         @rtype: float
00162         """
00163         sup=SVDSuperimposer()
00164         sup.set(self.coords_ca, other.coords_ca)
00165         sup.run()
00166         return sup.get_rms()

def Bio.PDB.FragmentMapper.Fragment.add_residue (   self,
  resname,
  ca_coord 
)
@param resname: residue name (eg. GLY).
@type resname: string

@param ca_coord: the c-alpha coorinates of the residues
@type ca_coord: Numeric array with length 3

Definition at line 131 of file FragmentMapper.py.

00131 
00132     def add_residue(self, resname, ca_coord):
00133         """
00134         @param resname: residue name (eg. GLY).
00135         @type resname: string
00136 
00137         @param ca_coord: the c-alpha coorinates of the residues
00138         @type ca_coord: Numeric array with length 3
00139         """
00140         if self.counter>=self.length:
00141             raise PDBException("Fragment boundary exceeded.")
00142         self.resname_list.append(resname)
00143         self.coords_ca[self.counter]=ca_coord
00144         self.counter=self.counter+1

@return: the CA coords in the fragment
@rtype: Numeric (Nx3) array

Definition at line 124 of file FragmentMapper.py.

00124 
00125     def get_coords(self):
00126         """
00127         @return: the CA coords in the fragment
00128         @rtype: Numeric (Nx3) array
00129         """
00130         return self.coords_ca

@return: id for the fragment
@rtype: int

Definition at line 117 of file FragmentMapper.py.

00117 
00118     def get_id(self):
00119         """
00120         @return: id for the fragment
00121         @rtype: int
00122         """
00123         return self.fid

@return: the residue names
@rtype: [string, string,...]

Definition at line 110 of file FragmentMapper.py.

00110 
00111     def get_resname_list(self):
00112         """
00113         @return: the residue names
00114         @rtype: [string, string,...]
00115         """
00116         return self.resname_list


Member Data Documentation

Definition at line 107 of file FragmentMapper.py.

Definition at line 104 of file FragmentMapper.py.

Definition at line 108 of file FragmentMapper.py.

Definition at line 102 of file FragmentMapper.py.

Definition at line 105 of file FragmentMapper.py.


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