Skip to content

Commit

Permalink
Fix bucket index by sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Mar 27, 2024
1 parent 5325ac0 commit 887dad2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,14 @@ public BucketIndexBySample(VariantStore variantStore, String storageDir) throws
// For each patient set the patientBucketCharMask entry to 0 or 1 if they have a variant in the bucket.

// todo: implement for variant explorer
/*int maxIndex = patientMaskForBucket[0].bitLength() - 1;
int indexOfBucket = Collections.binarySearch(bucketList, bucketKey) + 2; //patientBucketCharMasks has bookend bits
for(int x = 2;x<patientMaskForBucket[0].bitLength()-2;x++) {
if(patientMaskForBucket[0].testBit(maxIndex - x)) { //testBit uses inverted indexes
patientBucketCharMasks[x-2][indexOfBucket] = '1';
for(int x = 0; x < patientIds.size(); x++) {
if(patientMaskForBucket[0].testBit(x)) {
patientBucketCharMasks[x][indexOfBucket] = '1';
}else {
patientBucketCharMasks[x-2][indexOfBucket] = '0';
patientBucketCharMasks[x][indexOfBucket] = '0';
}
}*/
}
});
} else {
log.info("null entry for contig " + contig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private VariantMask variantMaskFromRawString(String maskStringRaw) {
}

VariantMask variantMask;
BigInteger bitmask = new BigInteger(oneone + maskStringRaw + oneone, 2);
BigInteger bitmask = new BigInteger(oneone + new StringBuilder(maskStringRaw).reverse() + oneone, 2);
if (bitmask.bitCount() - 4 > VariableVariantMasks.SPARSE_VARIANT_THRESHOLD) {
variantMask = new VariantMaskBitmaskImpl(bitmask);
} else {
Expand Down

0 comments on commit 887dad2

Please sign in to comment.