Пример #1
0
def get_rmsd(pdb1, pdb2, segments1, segments2, atom_types):
    polymer1 = polymer.Polymer(pdb1)
    atoms1 = get_superposable_atoms(polymer1, segments1, atom_types)
    polymer2 = polymer.Polymer(pdb2)
    atoms2 = get_superposable_atoms(polymer2, segments2, atom_types)

    center1 = molecule.get_center(atoms1)
    polymer1.transform(vector3d.Translation(-center1))
    polymer2.transform(vector3d.Translation(-molecule.get_center(atoms2)))

    crds1 = get_crds(atoms1)
    crds2 = get_crds(atoms2)
    return rmsd(crds1, crds2)
Пример #2
0
def get_best_alignment_with_residues(pdb1, pdb2, segments1, segments2,
                                     atom_types):
    polymer1 = polymer.Polymer(pdb1)
    atoms1 = get_superposable_atoms(polymer1, segments1, atom_types)
    polymer2 = polymer.Polymer(pdb2)
    atoms2 = get_superposable_atoms(polymer2, segments2, atom_types)
    center1 = molecule.get_center(atoms1)
    polymer1.transform(vector3d.Translation(-center1))
    polymer2.transform(vector3d.Translation(-molecule.get_center(atoms2)))
    polymer2.transform(calculate_superposition_matrix(atoms1, atoms2))

    residue_rmsd, overall_rmsd = residues_rmsd(atoms1, atoms2)
    return residue_rmsd, overall_rmsd
Пример #3
0
def get_best_alignment(pdb1, pdb2, segments1, segments2, atom_types):
    """Returns rmsd and filename of transformed pdb2."""
    polymer1 = polymer.Polymer(pdb1)
    atoms1 = get_superposable_atoms(polymer1, segments1, atom_types)
    polymer2 = polymer.Polymer(pdb2)
    atoms2 = get_superposable_atoms(polymer2, segments2, atom_types)
    center1 = molecule.get_center(atoms1)
    polymer1.transform(vector3d.Translation(-center1))
    polymer2.transform(vector3d.Translation(-molecule.get_center(atoms2)))
    polymer2.transform(calculate_superposition_matrix(atoms1, atoms2))

    rmsd = sum_rmsd(atoms1, atoms2)
    return rmsd
Пример #4
0
 def com_to_zero(self):
     self.transform(vector3d.Translation(-self.com()))
Пример #5
0
 def center_box(self):
     sys.stderr.write("Centering the box around " +
                      str(self._box_center.x) + " " +
                      str(self._box_center.y) + " " +
                      str(self._box_center.z) + "\n")
     self.transform(vector3d.Translation(-self._box_center))