/** * Transform an array of atoms at once. The transformation Matrix must be a * post-multiplication Matrix. * * @param ca * array of Atoms to shift * @param t * transformation Matrix4d */ public static void transform(Atom[] ca, Matrix4d t) { for (Atom atom : ca) Calc.transform(atom, t); }
/** * Transforms a chain object, given a Matrix4d (i.e. the vecmath library * double-precision 4x4 rotation+translation matrix). The transformation * Matrix must be a post-multiplication Matrix. * * @param chain * @param m */ public static final void transform (Chain chain, Matrix4d m) { for (Group g : chain.getAtomGroups()) { transform(g, m); } }
/** * Transforms a group object, given a Matrix4d (i.e. the vecmath library * double-precision 4x4 rotation+translation matrix). The transformation * Matrix must be a post-multiplication Matrix. * * @param group * @param m */ public static final void transform(Group group, Matrix4d m) { for (Atom atom : group.getAtoms()) { transform(atom, m); } for (Group altG : group.getAltLocs()) { transform(altG, m); } }
/** * Transforms a structure object, given a Matrix4d (i.e. the vecmath library * double-precision 4x4 rotation+translation matrix). The transformation * Matrix must be a post-multiplication Matrix. * * @param structure * @param m */ public static final void transform(Structure structure, Matrix4d m) { for (int n=0; n<structure.nrModels();n++) { for (Chain c : structure.getChains(n)) { transform(c, m); } } }
public void setBbs(Structure structure, Matrix4d[] ops, boolean includeHetAtoms) { setBb(structure, includeHetAtoms, 0); for (int i=1;i<ops.length;i++) { Structure sym = structure.clone(); Calc.transform(sym, ops[i]); setBb(sym, includeHetAtoms, i); } }
Calc.transform(a, blockTrans); transformedAtoms[transformedAtomsLength] = a; transformedAtomsLength++;
/** * Return the rmsd of the CAs between the input pro and this protein, at * given positions. quite similar to transPdb but while that one transforms * the whole ca2, this one only works on the res1 and res2 positions. * * Modifies the coordinates in the second set of Atoms (pro). * * @return rmsd of CAs */ private static double calCaRmsd(Atom[] ca1, Atom[] pro, int resn, int[] res1, int[] res2) throws StructureException { Atom[] cod1 = getAtoms(ca1, res1, resn, false); Atom[] cod2 = getAtoms(pro, res2, resn, false); if (cod1.length == 0 || cod2.length == 0) { logger.info("length of atoms == 0!"); return 99; } Matrix4d transform = SuperPositions.superpose(Calc.atomsToPoints(cod1), Calc.atomsToPoints(cod2)); for (Atom a : cod2) Calc.transform(a.getGroup(), transform); return Calc.rmsd(cod1, cod2); }
Calc.transform(clonedChain, m);
Calc.atomsToPoints(catmp2)); Calc.transform(catmp2, trans);
Calc.transform(displayS, transf.get(i)); rotatedAtoms.add(rotCA);
translate(mJCryst, transOrth); chainj = (Chain)chainj.clone(); Calc.transform(chainj,mJCryst);
Calc.transform(a.getGroup(), trans);
Calc.transform(chain, transformation.getTransformationMatrix());
Calc.transform(a.getGroup(), transform);
/** superimpose and get rmsd * * @param pro1 * @param pro2 * @param strLen Number of atoms from pro1 and pro2 to use * @param storeTransform Store rotation and shift matrices locally * @return RMSD * @throws StructureException */ public double calc_rmsd(Atom[] pro1, Atom[] pro2, int strLen, boolean storeTransform) throws StructureException { Atom[] cod1 = getAtoms(pro1, strLen,false); Atom[] cod2 = getAtoms(pro2, strLen,true); Matrix4d trans = SuperPositions.superpose(Calc.atomsToPoints(cod1), Calc.atomsToPoints(cod2)); Matrix matrix = Matrices.getRotationJAMA(trans); Atom shift = Calc.getTranslationVector(trans); if ( storeTransform) { r = matrix; t = shift; } for (Atom a : cod2) Calc.transform(a.getGroup(), trans); return Calc.rmsd(cod1, cod2); }
Calc.atomsToPoints(ca2aligned)); Calc.transform(ca2aligned, trans);
Calc.transform(a.getGroup(), trans);
blockShifts[k] = Calc.getTranslationVector(trans); Calc.transform(ca2block, transb);