import jalview.datamodel.Annotation;
import jalview.datamodel.SequenceI;
import jalview.ext.android.SparseIntArray;
+import jalview.util.Comparison;
import jalview.util.Format;
import jalview.util.MappingUtils;
import jalview.util.QuickSort;
public static final void calculate(SequenceI[] sequences, int start,
int end, Hashtable[] result, boolean profile)
{
- // long now = System.currentTimeMillis();
+ long now = System.currentTimeMillis();
Hashtable residueHash;
int seqCount = sequences.length;
char c = '-';
{
c = seq[column];
- if (c == '.' || c == ' ')
- {
- c = '-';
- }
-
- if (c == '-')
+ if (Comparison.isGap(c))
{
// values['-']++;
// values.put('-', values.get('-') + 1);
- values.increment('-');
+ values.add('-', 1);
continue;
}
else if ('a' <= c && c <= 'z')
nongap++;
// values[c]++;
// values.put(c, values.get(c) + 1);
- values.increment(c);
+ values.add(c, 1);
}
else
{
+ /*
+ * here we count as a gap if the sequence doesn't
+ * reach this column (is that correct?)
+ */
// values['-']++;
// values.put('-', values.get('-') + 1);
- values.increment('-');
+ values.add('-', 1);
}
}
if (seqCount == 1)
{
int v = values.keyAt(k);
int count = values.valueAt(k); // values[v];
- if (count < 1 || count < maxCount)
+ if (v == '-' || count < 1 || count < maxCount)
{
continue;
}
result[column] = residueHash;
- profileSizes.increment(values.size());
+ profileSizes.add(values.size(), 1);
}
- // long elapsed = System.currentTimeMillis() - now;
- // System.out.println(elapsed);
+ long elapsed = System.currentTimeMillis() - now;
+ System.out.println(elapsed);
}
/**
boolean ignoreGapsInConsensusCalculation,
boolean includeAllConsSymbols, char[] alphabet, long nseq)
{
- // long now = System.currentTimeMillis();
+ long now = System.currentTimeMillis();
if (consensus == null || consensus.annotations == null
|| consensus.annotations.length < width)
{
consensus.annotations[i] = new Annotation(maxRes,
mouseOver.toString(), ' ', value);
}
- // long elapsed = System.currentTimeMillis() - now;
- // System.out.println(-elapsed);
+ long elapsed = System.currentTimeMillis() - now;
+ System.out.println(-elapsed);
}
/**