import jalview.datamodel.*;
/**
- * Takes in a vector or array of sequences and column start and column end
- * and returns a new Hashtable[] of size maxSeqLength, if Hashtable not supplied.
- * This class is used extensively in calculating alignment colourschemes
- * that depend on the amount of conservation in each alignment column.
+ * Takes in a vector or array of sequences and column start and column end and
+ * returns a new Hashtable[] of size maxSeqLength, if Hashtable not supplied.
+ * This class is used extensively in calculating alignment colourschemes that
+ * depend on the amount of conservation in each alignment column.
+ *
* @author $author$
* @version $Revision$
*/
public class AAFrequency
{
- //No need to store 1000s of strings which are not
- //visible to the user.
+ // No need to store 1000s of strings which are not
+ // visible to the user.
public static final String MAXCOUNT = "C";
+
public static final String MAXRESIDUE = "R";
+
public static final String PID_GAPS = "G";
+
public static final String PID_NOGAPS = "N";
public static final Hashtable[] calculate(Vector sequences, int start,
- int end)
+ int end)
{
SequenceI[] seqs = new SequenceI[sequences.size()];
int width = 0;
return reply;
}
- public static final void calculate(SequenceI[] sequences,
- int start, int end,
- Hashtable[] result)
+ public static final void calculate(SequenceI[] sequences, int start,
+ int end, Hashtable[] result)
{
Hashtable residueHash;
int maxCount, nongap, i, j, v, jSize = sequences.length;
}
else if ('a' <= c && c <= 'z')
{
- c -= 32; //('a' - 'A');
+ c -= 32; // ('a' - 'A');
}
nongap++;
if (values[v] > maxCount)
{
- maxResidue = String.valueOf( (char) v);
+ maxResidue = String.valueOf((char) v);
}
else if (values[v] == maxCount)
{
- maxResidue += String.valueOf( (char) v);
+ maxResidue += String.valueOf((char) v);
}
maxCount = values[v];
}
residueHash.put(MAXCOUNT, new Integer(maxCount));
residueHash.put(MAXRESIDUE, maxResidue);
- percentage = ( (float) maxCount * 100) / (float) jSize;
+ percentage = ((float) maxCount * 100) / (float) jSize;
residueHash.put(PID_GAPS, new Float(percentage));
- percentage = ( (float) maxCount * 100) / (float) nongap;
+ percentage = ((float) maxCount * 100) / (float) nongap;
residueHash.put(PID_NOGAPS, new Float(percentage));
result[i] = residueHash;
}