Skip to content

Commit

Permalink
PN-423: Matching algorithms should support hierarchical gene status
Browse files Browse the repository at this point in the history
  • Loading branch information
veronikaslc committed May 2, 2019
1 parent 87f1f7e commit f6eb49b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.phenotips.data.Patient;
import org.phenotips.data.PatientData;
import org.phenotips.data.PatientRepository;
import org.phenotips.data.PhenoTipsGene;
import org.phenotips.data.permissions.EntityAccess;
import org.phenotips.data.permissions.EntityPermissionsManager;
import org.phenotips.data.permissions.Owner;
Expand Down Expand Up @@ -317,15 +318,18 @@ private void appendGenesToQuery(PatientData<Gene> allGenes, StringBuilder q)
geneName = geneName.trim();
String status = gene.getStatus();
// Treat empty status as candidate
if (StringUtils.isBlank(status) || "solved".equals(status) || "candidate".equals(status)) {
if (StringUtils.isBlank(status) || "solved".equals(status) || status.startsWith("candidate")) {
genesToSearch.add(geneName);
}
}
}
if (!genesToSearch.isEmpty()) {
String geneQuery = getQueryFromTerms(genesToSearch);
q.append(" solved_genes:" + geneQuery);
q.append(" candidate_genes:" + geneQuery);
List<String> statusValues = PhenoTipsGene.getStatusValues();
statusValues.stream()
.filter(item -> item.startsWith("candidate"))
.forEach(item -> q.append(" " + item + ":" + geneQuery));
}
}

Expand Down

0 comments on commit f6eb49b

Please sign in to comment.