code: public static Graph<Integer, DefaultEdge> buildSymmetryGraph(
  			AFPChain selfAlignment) {
  
  		Graph<Integer, DefaultEdge> graph = new SimpleGraph<Integer, DefaultEdge>(
  				DefaultEdge.class);
  
  		for (int i = 0; i < selfAlignment.getOptAln().length; i++) {
  			for (int j = 0; j < selfAlignment.getOptAln()[i][0].length; j++) {
  				Integer res1 = selfAlignment.getOptAln()[i][0][j];
  				Integer res2 = selfAlignment.getOptAln()[i][1][j];
  				graph.addVertex(res1);
  				graph.addVertex(res2);
  				graph.addEdge(res1, res2);
  			}
  		}
  		return graph;
  	}
docs: Converts a self alignment into a directed jGraphT of aligned residues,
  where each vertex is a residue and each edge means the equivalence
  between the two residues in the self-alignment.
  
  @param selfAlignment
  AFPChain
  
  @return alignment Graph