def __sub__(self, other): """ Return rmsd between two fragments. Example: >>> rmsd=fragment1-fragment2 @return: rmsd between fragments @rtype: float """ sup = SVDSuperimposer() sup.set(self.coords_ca, other.coords_ca) sup.run() return sup.get_rms()
def __sub__(self, other): """ Return rmsd between two fragments. Example: >>> rmsd=fragment1-fragment2 @return: rmsd between fragments @rtype: float """ sup=SVDSuperimposer() sup.set(self.coords_ca, other.coords_ca) sup.run() return sup.get_rms()
def set_atoms(self, fixed, moving): """ 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},...] """ if not (len(fixed) == len(moving)): raise PDBException("Fixed and moving atom lists differ in size") l = len(fixed) fixed_coord = numpy.zeros((l, 3)) moving_coord = numpy.zeros((l, 3)) for i in range(0, len(fixed)): fixed_coord[i] = fixed[i].get_coord() moving_coord[i] = moving[i].get_coord() sup = SVDSuperimposer() sup.set(fixed_coord, moving_coord) sup.run() self.rms = sup.get_rms() self.rotran = sup.get_rotran()
def set_atoms(self, fixed, moving): """ 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},...] """ if not (len(fixed)==len(moving)): raise PDBException("Fixed and moving atom lists differ in size") l=len(fixed) fixed_coord=numpy.zeros((l, 3)) moving_coord=numpy.zeros((l, 3)) for i in range(0, len(fixed)): fixed_coord[i]=fixed[i].get_coord() moving_coord[i]=moving[i].get_coord() sup=SVDSuperimposer() sup.set(fixed_coord, moving_coord) sup.run() self.rms=sup.get_rms() self.rotran=sup.get_rotran()