boolean seqNumsChanged = false; // updated after any change via calcSeqNum;
- Hashtable<String, Integer>[] total;
+ Map<String, Integer>[] total;
boolean canonicaliseAa = true; // if true then conservation calculation will
// symbol
/** Stores calculated quality values */
- public Vector<Double> quality;
+ private Vector<Double> quality;
/** Stores maximum and minimum values of quality values */
private double[] qualityRange = new double[2];
- Sequence consSequence;
+ private Sequence consSequence;
- Map<String, Map<String, Integer>> propHash;
+ private int threshold;
- int threshold;
+ private String name = "";
- String name = "";
-
- int[][] cons2;
+ private int[][] cons2;
private String[] consSymbs;
*
* @param name
* Name of conservation
- * @param propHash
- * hash of properties for each symbol
* @param threshold
* to count the residues in residueHash(). commonly used value is 3
* @param sequences
* @param end
* end residue position
*/
- public Conservation(String name, Hashtable propHash, int threshold,
+ public Conservation(String name, int threshold,
List<SequenceI> sequences, int start, int end)
{
this.name = name;
- this.propHash = propHash;
this.threshold = threshold;
this.start = start;
this.end = end;
String res = String.valueOf(v);
// Now loop over the properties
- for (String type : propHash.keySet())
+ for (String type : ResidueProperties.propHash.keySet())
{
- Hashtable<String, Integer> ht = (Hashtable<String, Integer>) propHash
- .get(type);
+ Map<String, Integer> ht = ResidueProperties.propHash.get(type);
// Have we ticked this before?
if (!resultHash.containsKey(type))
if (percentageGaps > pgaps)
{
- Hashtable<String, Integer> resultHash = total[i - start];
+ Map<String, Integer> resultHash = total[i - start];
// Now find the verdict
int count = 0;
for (String type : resultHash.keySet())
{
tot = 0;
xx = new double[24];
- seqNum = (j < lengths[k]) ? seqNums.elementAt(k)[j + 1]
- : 23; // Sequence, or gap at the end
+ seqNum = (j < lengths[k]) ? seqNums.elementAt(k)[j + 1] : 23; // Sequence,
+ // or gap
+ // at the
+ // end
// This is a loop over r
for (i = 0; i < 23; i++)
*
* @param name
* - name of conservation
- * @param consHash
- * - hash table of properties for each amino acid (normally
- * ResidueProperties.propHash)
* @param threshold
* - minimum number of conserved residues needed to indicate
* conservation (typically 3)
* @return Conservation object ready for use in visualization
*/
public static Conservation calculateConservation(String name,
- Hashtable consHash, int threshold, List<SequenceI> seqs,
- int start, int end, boolean posOrNeg, int consPercGaps,
- boolean calcQuality)
- {
- Conservation cons = new Conservation(name, consHash, threshold, seqs,
- start, end);
- return calculateConservation(cons, posOrNeg, consPercGaps, calcQuality);
- }
-
- /**
- * @param b
- * positive (true) or negative (false) conservation
- * @param consPercGaps
- * percentage of gaps tolerated in column
- * @param calcQuality
- * flag indicating if alignment quality should be calculated
- * @return Conservation object ready for use in visualization
- */
- public static Conservation calculateConservation(Conservation cons,
- boolean b, int consPercGaps, boolean calcQuality)
+ int threshold, List<SequenceI> seqs, int start, int end,
+ boolean posOrNeg, int consPercGaps, boolean calcQuality)
{
+ Conservation cons = new Conservation(name, threshold, seqs, start, end);
cons.calculate();
- cons.verdict(b, consPercGaps);
+ cons.verdict(posOrNeg, consPercGaps);
if (calcQuality)
{