code: public static AFPChain postProcessAlignment(AFPChain afpChain, Atom[] ca1, Atom[] ca2m,CECalculator calculator, CECPParameters param ) throws StructureException{
  
  		// remove bottom half of the matrix
  		Matrix doubledMatrix = afpChain.getDistanceMatrix();
  
  		// the matrix can be null if the alignment is too short.
  		if ( doubledMatrix != null ) {
  			assert(doubledMatrix.getRowDimension() == ca1.length);
  			assert(doubledMatrix.getColumnDimension() == ca2m.length);
  
  			Matrix singleMatrix = doubledMatrix.getMatrix(0, ca1.length-1, 0, (ca2m.length/2)-1);
  			assert(singleMatrix.getRowDimension() == ca1.length);
  			assert(singleMatrix.getColumnDimension() == (ca2m.length/2));
  
  			afpChain.setDistanceMatrix(singleMatrix);
  		}
  		// Check for circular permutations
  		int alignLen = afpChain.getOptLength();
  		if ( alignLen > 0) {
  			afpChain = filterDuplicateAFPs(afpChain,calculator,ca1,ca2m,param);
  		}
  		return afpChain;
  	}
docs: Circular permutation specific code to be run after the standard CE alignment
  
  @param afpChain The finished alignment
  @param ca1 CA atoms of the first protein
  @param ca2m A duplicated copy of the second protein
  @param calculator The CECalculator used to create afpChain
  @param param Parameters
  @throws StructureException