Skip to content

Commit

Permalink
ALS-6330: Implement createMaskForPatientSet for patient merging genom…
Browse files Browse the repository at this point in the history
…ic processor
  • Loading branch information
ramari16 committed Jun 11, 2024
1 parent dd89834 commit 9d17741
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public VariantMask createMaskForPatientSet(Set<Integer> patientSubset) {
VariantMask result = nodes.parallelStream()
.map(node -> node.createMaskForPatientSet(patientSubset))
.reduce(VariantMask::union)
.orElse(VariantMask.emptyInstance());
.orElseGet(VariantMask::emptyInstance);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public Set<Integer> patientMaskToPatientIdSet(VariantMask patientMask) {

@Override
public VariantMask createMaskForPatientSet(Set<Integer> patientSubset) {
throw new RuntimeException("Not implemented");
return nodes.stream()
.map(node -> new SizedVariantMask(node.createMaskForPatientSet(patientSubset), node.getPatientIds().size()))
.reduce(this::appendMask)
.map(SizedVariantMask::getVariantMask)
.orElseGet(VariantMask::emptyInstance);
}

@Override
Expand Down

0 comments on commit 9d17741

Please sign in to comment.