public int markColumns(SequenceCollectionI sqcol, BitSet bs)
{
int count = 0;
+ BitSet mask = new BitSet();
for (SequenceI s : sqcol.getSequences())
{
- BitSet mask = new BitSet();
int[] cols = getResults(s, sqcol.getStartRes(), sqcol.getEndRes());
if (cols != null)
{
mask.set(cols[pair], cols[pair + 1] + 1);
}
}
- // find columns that were already selected
- BitSet compl = (BitSet) mask.clone();
- compl.and(bs);
- count += compl.cardinality();
- // and mark ranges not already marked
- bs.or(mask);
}
+ // compute columns that were newly selected
+ BitSet original = (BitSet) bs.clone();
+ original.and(mask);
+ count = mask.cardinality() - original.cardinality();
+ // and mark ranges not already marked
+ bs.or(mask);
return count;
}