Add support for ONE OF constraints
ONE OF constraints aren't handled correctly by InterMineR and convert to invalid query XML.
pancreasConstraint1 = setConstraints(
paths = c("Gene", "Gene.proteinAtlasExpression.level", "Gene.proteinAtlasExpression.tissue.name"),
operators = c("IN", "ONE OF", "="),
values = list("PL_DiabetesGenes", c("Medium", "High"), "Pancreas")
)
This constraint will return a 400 when run, because it's creating the following XML:
<query name="" model="genomic" view="Gene.primaryIdentifier Gene.symbol Gene.proteinAtlasExpression.cellType Gene.proteinAtlasExpression.level Gene.proteinAtlasExpression.tissue.name" longDescription="" sortOrder="Gene.primaryIdentifier ASC">
<constraint path="Gene" value="PL_DiabetesGenes" code="A" op="IN" extraValue=""/>
<constraint path="Gene.proteinAtlasExpression.level" value="Medium" code="B" op="ONE OF" extraValue=""/>
<constraint path="Gene.proteinAtlasExpression.tissue.name" value="Pancreas" code="C" op="=" extraValue=""/>
</query>
But it should be making something more like:
<query name="" model="genomic" view="Gene.primaryIdentifier Gene.symbol Gene.proteinAtlasExpression.cellType Gene.proteinAtlasExpression.level Gene.proteinAtlasExpression.tissue.name" longDescription="" sortOrder="Gene.primaryIdentifier ASC">
<constraint path="Gene" value="PL_DiabetesGenes" code="A" op="IN" extraValue=""/>
<constraint path="Gene.proteinAtlasExpression.level" op="ONE OF" code="B" >
<value>Medium</value>
<value>High</value>
</constraint>
<constraint path="Gene.proteinAtlasExpression.tissue.name" value="Pancreas" code="C" op="=" extraValue=""/>
</query>
The full R query to reproduce this error is here:
https://gist.github.com/yochannah/da70107869bd57e739a47aad07ccb936
I've added the Hacktoberfest label in case anyone would like to work on this issue. I think most of the info needed is present in this issue. We'll need to update setConstraint to create XML similar to my "correct" example - but note it should take any number of arguments to the ONE OF param, not just medium and high.
More information on InterMine pathquery XML is available here if you need it: https://intermine.readthedocs.io/en/latest/api/pathquery/
if you want to pick up this task
- Take a look at the InterMine contributing guidelines
- Comment on this issue stating that you intend to work on the task
- When you're ready, add your work to the repo and create a pull request.
What to do if you need help
Mention @yochannah, tweet @yoyehudi, pop by to say hi on chat or if needed email [email protected]. Don't forget we're usually only available during uk office hours and will not be able to respond at other times :)