Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ONE OF constraints #55

Open
yochannah opened this issue Jun 12, 2019 · 2 comments
Open

Add support for ONE OF constraints #55

yochannah opened this issue Jun 12, 2019 · 2 comments

Comments

@yochannah
Copy link
Member

yochannah commented Jun 12, 2019

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> 
@yochannah
Copy link
Member Author

The full R query to reproduce this error is here:

https://gist.github.com/yochannah/da70107869bd57e739a47aad07ccb936

@yochannah
Copy link
Member Author

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

  1. Take a look at the InterMine contributing guidelines
  2. Comment on this issue stating that you intend to work on the task
  3. 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant