code: public static double getRefRMSD(MultipleAlignment alignment, int ref) {
  		List<Atom[]> trans = MultipleAlignmentTools.transformAtoms(alignment);
  		return getRefRMSD(trans, ref);
  	}
docs: /** Calculates the average RMSD from all structures to a reference s
  tructure, given a set of superimposed atoms.
  <p>
  Complexity: T(n,l) = O(l*n), if n=number of structures and l=alignment
  length.
  <p>
  For ungapped alignments, this is just the sqroot of the average distance
  from an atom to the aligned atom from the reference. Thus, for R
  structures aligned over C columns (with structure 0 as the reference), we
  have:
  
  <pre>
  RefRMSD = \sqrt{ 1/(C*(R-1)) * \sum_{r=1}^{R-1} \sum_{j=0}^{C-1}
  (atom[1][c]-atom[r][c])^2 }
  </pre>
  <p>
  For gapped alignments, null atoms are omitted from consideration, so that
  the RMSD is the average over all columns with non-null reference of the
  average RMSD within the non-null elements of the column.
  
  @param alignment
  MultipleAlignment
  @param ref
  reference structure index
  @return