Skip to content

Commit

Permalink
Handle null variant masks
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Mar 16, 2024
1 parent 165d380 commit 3cd01c3
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@ public VariantMask getPatientIdsForIntersectionOfVariantSets(Set<Integer> patien
variantBucket.forEach(variantSpec -> {
Optional<VariableVariantMasks> variantMask = variantService.getMasks(variantSpec, bucketCache);
variantMask.ifPresentOrElse(masks -> {
VariantMask heteroMask = masks.heterozygousMask;
VariantMask homoMask = masks.homozygousMask;
VariantMask orMasks = heteroMask.union(homoMask);
VariantMask heterozygousMask = masks.heterozygousMask;
VariantMask homozygousMask = masks.homozygousMask;
//log.info("Patients with variant " + variantSpec + ": " + (orMasks.bitCount() - 4));
synchronized(matchingPatients) {
matchingPatients[0] = matchingPatients[0].union(orMasks);
if (heterozygousMask != null) {
synchronized(matchingPatients) {
matchingPatients[0] = matchingPatients[0].union(heterozygousMask);
}
}
if (homozygousMask != null) {
synchronized(matchingPatients) {
matchingPatients[0] = matchingPatients[0].union(homozygousMask);
}
}
}, () -> missingVariants.add(variantSpec));
});
Expand Down

0 comments on commit 3cd01c3

Please sign in to comment.