Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Mar 27, 2024
1 parent acec7bc commit 02a8506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public int bitCount() {
public Set<Integer> patientMaskToPatientIdSet(List<String> patientIds) {
Set<Integer> ids = new HashSet<>();
for(int x = 0;x < bitmask.bitLength()-4;x++) {
if(testBit(x + 2)) {
if(testBit(x)) {
String patientId = patientIds.get(x).trim();
ids.add(Integer.parseInt(patientId));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ public VariantMask getPatientIdsForIntersectionOfVariantSets(Set<Integer> patien
// todo: return VariantMask
public BigInteger createMaskForPatientSet(Set<Integer> patientSubset) {
StringBuilder builder = new StringBuilder("11"); //variant bitmasks are bookended with '11'
for(String patientId : variantService.getPatientIds()) {
Integer idInt = Integer.parseInt(patientId);

for (int i = variantService.getPatientIds().length - 1; i >= 0; i--) {
Integer idInt = Integer.parseInt(variantService.getPatientIds()[i]);
if(patientSubset.contains(idInt)){
builder.append("1");
} else {
Expand All @@ -122,8 +123,6 @@ public BigInteger createMaskForPatientSet(Set<Integer> patientSubset) {
}
builder.append("11"); // masks are bookended with '11' set this so we don't count those

// log.debug("PATIENT MASK: " + builder.toString());

BigInteger patientMasks = new BigInteger(builder.toString(), 2);
return patientMasks;
}
Expand Down

0 comments on commit 02a8506

Please sign in to comment.