Back to index

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

List of all members.

Public Member Functions

def __init__
def set_atoms
def apply

Public Attributes


Detailed Description

Rotate/translate one set of atoms on top of another,
thereby minimizing the RMSD.

Definition at line 14 of file

Constructor & Destructor Documentation

Definition at line 19 of file

00020     def __init__(self):
00021         self.rotran=None
00022         self.rms=None

Member Function Documentation

def Bio.PDB.Superimposer.Superimposer.apply (   self,
Rotate/translate a list of atoms.

Definition at line 46 of file

00047     def apply(self, atom_list):
00048         """
00049         Rotate/translate a list of atoms.
00050         """
00051         if self.rotran is None:
00052             raise PDBException("No transformation has been calculated yet")
00053         rot, tran=self.rotran
00054         rot=rot.astype('f')
00055         tran=tran.astype('f')
00056         for atom in atom_list:
00057             atom.transform(rot, tran)

def Bio.PDB.Superimposer.Superimposer.set_atoms (   self,
Put (translate/rotate) the atoms in fixed on the atoms in 
moving, in such a way that the RMSD is minimized.

@param fixed: list of (fixed) atoms
@param moving: list of (moving) atoms 
@type fixed,moving: [L{Atom}, L{Atom},...]

Definition at line 23 of file

00024     def set_atoms(self, fixed, moving):
00025         """
00026         Put (translate/rotate) the atoms in fixed on the atoms in 
00027         moving, in such a way that the RMSD is minimized.
00029         @param fixed: list of (fixed) atoms
00030         @param moving: list of (moving) atoms 
00031         @type fixed,moving: [L{Atom}, L{Atom},...]
00032         """
00033         if not (len(fixed)==len(moving)):
00034             raise PDBException("Fixed and moving atom lists differ in size")
00035         l=len(fixed)
00036         fixed_coord=numpy.zeros((l, 3))
00037         moving_coord=numpy.zeros((l, 3))
00038         for i in range(0, len(fixed)):
00039             fixed_coord[i]=fixed[i].get_coord()
00040             moving_coord[i]=moving[i].get_coord()
00041         sup=SVDSuperimposer()
00042         sup.set(fixed_coord, moving_coord)
00044         self.rms=sup.get_rms()
00045         self.rotran=sup.get_rotran()

Member Data Documentation

Definition at line 21 of file

Definition at line 20 of file

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