private void superimposeBySet ( ) throws StructureException { //extract the coordinations of equivalent residues Atom [ ] tmp1 = new Atom [ equLen ] ; Atom [ ] tmp2 = new Atom [ equLen ] ; int i , r1 , r2 ; for ( i = 0 ; i < equLen ; i ++ ) { r1 = equSet [ 0 ] [ i ] ; r2 = equSet [ 1 ] [ i ] ; tmp1 [ i ] = cod1 [ r1 ] ; tmp2 [ i ] = ( Atom ) cod2 [ r2 ] . clone ( ) ; // have to be cloned! //tmp2[i] = cod2[ r2 ]; /*try { System.out.println("before superimpos: " + equSet[0][i]+"-"+ equSet[1][i]+ " dist:" + Calc.getDistance(tmp1[i], cod2[equSet[1][i]])); } catch (Exception e){ e.printStackTrace(); }*/ } //superimpose the equivalent residues Matrix4d trans = SuperPositions . superpose ( Calc . atomsToPoints ( tmp1 ) , Calc . atomsToPoints ( tmp2 ) ) ; Calc . transform ( tmp2 , trans ) ; // weird, why does it take the RMSD before the rotation? // the rmsd is only for the subset contained in the tmp arrays. rmsd = Calc . rmsd ( tmp1 , tmp2 ) ; //System.err.println("rmsd after superimpose by set: " + rmsd); //transform structure 2 according to the superimposition of the equivalent residues Calc . transform ( cod2 , trans ) ; // for(i = 0; i < equLen; i ++) { // try { // System.err.println("after superimpos: " + equSet[0][i]+"-"+ equSet[1][i]+ " dist:" + Calc.getDistance(tmp1[i], cod2[equSet[1][i]])); // } catch (Exception e){ // e.printStackTrace(); // } // } }
superimpose two structures according to the equivalent residues