diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientVariantJoinHandler.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientVariantJoinHandler.java index 5cc66fd3..0749ed27 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientVariantJoinHandler.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientVariantJoinHandler.java @@ -78,9 +78,9 @@ public BigInteger getPatientIdsForIntersectionOfVariantSets(Set patient BigInteger heteroMask = masks.heterozygousMask == null ? variantService.emptyBitmask() : masks.heterozygousMask; BigInteger homoMask = masks.homozygousMask == null ? variantService.emptyBitmask() : masks.homozygousMask; BigInteger orMasks = heteroMask.or(homoMask); - BigInteger andMasks = orMasks.and(patientsInScopeMask); + log.info("Patients with variant " + variantSpec + ": " + (orMasks.bitCount())); synchronized(matchingPatients) { - matchingPatients[0] = matchingPatients[0].or(andMasks); + matchingPatients[0] = matchingPatients[0].or(orMasks); } }, () -> missingVariants.add(variantSpec)); }); @@ -90,7 +90,7 @@ public BigInteger getPatientIdsForIntersectionOfVariantSets(Set patient } }); } - return matchingPatients[0]; + return matchingPatients[0].and(patientsInScopeMask); }else { log.error("No matches found for info filters."); return createMaskForPatientSet(new HashSet<>());