code: private static void permuteAFPChain(AFPChain afpChain, int cp) {
  
  		int ca2len = afpChain.getCa2Length();
  
  		//fix up cp to be positive
  		if(cp == 0) {
  			return;
  		}
  		if(cp < 0) {
  			cp = ca2len+cp;
  		}
  		if(cp < 0 || cp >= ca2len) {
  			throw new ArrayIndexOutOfBoundsException(
  					"Permutation point ("+cp+") must be between -ca2.length and ca2.length-1" );
  		}
  
  		// Fix up optAln
  		permuteOptAln(afpChain,cp);
  
  		if(afpChain.getBlockNum() > 1)
  			afpChain.setSequentialAlignment(false);
  		// fix up matrices
  		// ca1 corresponds to row indices, while ca2 corresponds to column indices.
  		afpChain.setDistanceMatrix(permuteMatrix(afpChain.getDistanceMatrix(),0,-cp));
  		// this is square, so permute both
  		afpChain.setDisTable2(permuteMatrix(afpChain.getDisTable2(),-cp,-cp));
  
  		//TODO fix up other AFP parameters?
  
  	}
docs: Permute the second protein of afpChain by the specified number of residues.
  @param afpChain Input alignment
  @param cp Amount leftwards (or rightward, if negative) to shift the
  @return A new alignment equivalent to afpChain after the permutations