Skip to content

Commit

Permalink
ALS-4978: Fix config issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Oct 16, 2023
1 parent 3fc4b64 commit ce53d37
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,24 @@ protected Set<Integer> idSetsForEachFilter(Query query) {

if (distributableQuery.hasFilters()) {
BigInteger patientMaskForVariantInfoFilters = genomicProcessor.getPatientMaskForVariantInfoFilters(distributableQuery);
return patientMaskToPatientIdSet(patientMaskForVariantInfoFilters);
}

return phenotypicPatientSet;
}

public Set<Integer> patientMaskToPatientIdSet(BigInteger patientMask) {
Set<Integer> ids = new HashSet<>();
String bitmaskString = patientMask.toString(2);
for(int x = 2;x < bitmaskString.length()-2;x++) {
if('1'==bitmaskString.charAt(x)) {
String patientId = variantService.getPatientIds()[x-2].trim();
ids.add(Integer.parseInt(patientId));
}
}
return ids;
}

/**
* Process each filter in the query and return a list of patient ids that should be included in the
* result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ public class GenomicProcessor {
private final VariantService variantService;

@Autowired
public GenomicProcessor(PatientVariantJoinHandler patientVariantJoinHandler, VariantIndexCache variantIndexCache, VariantService variantService) {
public GenomicProcessor(PatientVariantJoinHandler patientVariantJoinHandler, VariantService variantService) {
this.patientVariantJoinHandler = patientVariantJoinHandler;
this.variantIndexCache = variantIndexCache;
this.variantService = variantService;

genomicDataDirectory = System.getProperty("HPDS_GENOMIC_DATA_DIRECTORY", "/opt/local/hpds/all/");
Expand Down Expand Up @@ -97,7 +96,7 @@ protected BigInteger getPatientMaskForVariantInfoFilters(DistributableQuery dist
}

public Set<Integer> patientMaskToPatientIdSet(BigInteger patientMask) {
Set<Integer> ids = new TreeSet<Integer>();
Set<Integer> ids = new HashSet<>();
String bitmaskString = patientMask.toString(2);
for(int x = 2;x < bitmaskString.length()-2;x++) {
if('1'==bitmaskString.charAt(x)) {
Expand Down

0 comments on commit ce53d37

Please sign in to comment.