From a42d7dae63f4b9dd996fc9713677eb11f0bbed9a Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Mon, 29 Jan 2024 14:58:04 -0500 Subject: [PATCH] Add logging to triage missing variant mask issue --- .../dbmi/avillach/hpds/data/genotype/VariantStore.java | 2 +- .../hpds/processing/PatientVariantJoinHandler.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/data/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/genotype/VariantStore.java b/data/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/genotype/VariantStore.java index 822ea447..3efdc3df 100644 --- a/data/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/genotype/VariantStore.java +++ b/data/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/genotype/VariantStore.java @@ -142,7 +142,7 @@ public Optional getMasks(String variant, VariantBucketHolder patient List> variantBuckets = variantBucketPartitions.get(x); variantBuckets.parallelStream().forEach(variantBucket -> { VariantBucketHolder bucketCache = new VariantBucketHolder<>(); + List missingVariants = new ArrayList<>(); variantBucket.forEach(variantSpec -> { - variantService.getMasks(variantSpec, bucketCache).ifPresent(masks -> { + Optional variantMask = variantService.getMasks(variantSpec, bucketCache); + variantMask.ifPresentOrElse(masks -> { BigInteger heteroMask = masks.heterozygousMask == null ? variantService.emptyBitmask() : masks.heterozygousMask; BigInteger homoMask = masks.homozygousMask == null ? variantService.emptyBitmask() : masks.homozygousMask; BigInteger orMasks = heteroMask.or(homoMask); @@ -79,8 +82,10 @@ public BigInteger getPatientIdsForIntersectionOfVariantSets(Set patient synchronized(matchingPatients) { matchingPatients[0] = matchingPatients[0].or(andMasks); } - }); + }, () -> missingVariants.add(variantSpec)); }); + log.info(missingVariants.size() + "variant masks not found"); + log.info("Variants missing masks: " + Joiner.on(",").join( missingVariants.subList(0, 100))); }); } return matchingPatients[0];