Guest User

Untitled

a guest
May 28th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. # Good Query
  2. This query is the same as the above, but note the constraint in the code.
  3.  
  4. ```R
  5. im <- initInterMine(mine=listMines()["HumanMine"])
  6. queryGeneOrth = getTemplateQuery(
  7. im = im,
  8. name = "Gene_Orth"
  9. )
  10. newConstraint <- list(
  11. path=c("Gene.homologues.homologue.organism.shortName"),
  12. op=c("!="),
  13. value=c("H. sapiens"),
  14. code=c("B")
  15. )
  16. queryGeneOrth$where[[2]] <- newConstraint
  17. resGeneOrth <- runQuery(im, queryGeneOrth)
  18. ```
  19.  
  20. # Bad Query
  21. This query is bad because it's missing a constraint code. It'll make InterMine return a 400 error.
  22.  
  23. ```R
  24. im <- initInterMine(mine=listMines()["HumanMine"])
  25. queryGeneOrth = getTemplateQuery(
  26. im = im,
  27. name = "Gene_Orth"
  28. )
  29. newConstraint <- list(
  30. path=c("Gene.homologues.homologue.organism.shortName"),
  31. op=c("!="),
  32. value=c("H. sapiens")
  33. )
  34. queryGeneOrth$where[[2]] <- newConstraint
  35. resGeneOrth <- runQuery(im, queryGeneOrth)
  36. ```
Add Comment
Please, Sign In to add comment