code: public static int afp2Res(AFPChain afpChain, int afpn, int[] afpPositions,
  			int listStart) {
  		int[] res1 = afpChain.getFocusRes1();
  		int[] res2 = afpChain.getFocusRes2();
  		int minLen = afpChain.getMinLen();
  
  		int n = 0;
  
  		List<AFP> afpSet = afpChain.getAfpSet();
  
  		for (int i = listStart; i < listStart + afpn; i++) {
  			int a = afpPositions[i];
  			for (int j = 0; j < afpSet.get(a).getFragLen(); j++) {
  				if (n >= minLen) {
  					throw new RuntimeException(
  							"Error: too many residues in AFPChainer.afp2Res!");
  				}
  				res1[n] = afpSet.get(a).getP1() + j;
  				res2[n] = afpSet.get(a).getP2() + j;
  				n++;
  			}
  		}
  
  		afpChain.setFocusRes1(res1);
  		afpChain.setFocusRes2(res2);
  		afpChain.setFocusResn(n);
  
  		if (n == 0) {
  			logger.warn("n=0!!! + " + afpn + " " + listStart + " "
  					+ afpPositions.length);
  		}
  		return n;
  	}
docs: Set the list of equivalent residues in the two proteins given a list of
  AFPs
  
  WARNING: changes the values for FocusRes1, focusRes2 and FocusResn in
  afpChain!
  
  @param afpChain
  the AFPChain to store resuts
  @param afpn
  nr of afp
  @param afpPositions
  @param listStart
  @return nr of eq residues