code: private static void transformOrigPDB(int n, int[] res1, int[] res2,
  			Atom[] ca1, Atom[] ca2, AFPChain afpChain, int blockNr)
  			throws StructureException {
  		logger.debug(
  				"transforming original coordinates {} len1: {} res1: {} len2: {} res2: {}",
  				n, ca1.length, res1.length, ca2.length, res2.length);
  
  		Atom[] cod1 = getAtoms(ca1, res1, n, false);
  		Atom[] cod2 = getAtoms(ca2, res2, n, false);
  
  		// double *cod1 = pro1->Cod4Res(n, res1);
  		// double *cod2 = pro2->Cod4Res(n, res2);
  
  		Matrix4d transform = SuperPositions.superpose(Calc.atomsToPoints(cod1),
  				Calc.atomsToPoints(cod2));
  
  		Matrix r = Matrices.getRotationJAMA(transform);
  		Atom t = Calc.getTranslationVector(transform);
  
  		logger.debug("transPdb: transforming orig coordinates with matrix: {}",
  				r);
  
  		if (afpChain != null) {
  			Matrix[] ms = afpChain.getBlockRotationMatrix();
  			if (ms == null)
  				ms = new Matrix[afpChain.getBlockNum()];
  
  			ms[blockNr] = r;
  
  			Atom[] shifts = afpChain.getBlockShiftVector();
  			if (shifts == null)
  				shifts = new Atom[afpChain.getBlockNum()];
  			shifts[blockNr] = t;
  
  			afpChain.setBlockRotationMatrix(ms);
  			afpChain.setBlockShiftVector(shifts);
  		}
  
  		for (Atom a : ca2)
  			Calc.transform(a.getGroup(), transform);
  
  	}
docs: orig name: transPdb