Skip to content

Instantly share code, notes, and snippets.

@andrawaag
Created November 13, 2013 16:21
Show Gist options
  • Save andrawaag/7451821 to your computer and use it in GitHub Desktop.
Save andrawaag/7451821 to your computer and use it in GitHub Desktop.
curl "http://sparql.bioontology.org/sparql/?query=PREFIX+omv%3A+%3Chttp%3A%2F%2Fomv.ontoware.org%2F2005%2F05%2Fontology%23%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0ASELECT+DISTINCT+%3Fdisease+%3Flabel+%3Ftype+%0D%0AWHERE+%7B%0D%0A%09%0D%0A++++++++%3Fdisease+rdfs%3Alabel+%3Flabel+.%0D%0A++++++++%3Fdisease+rdf%3Atype+%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23Concept%3E+.%0D%0A%7D%0D%0A%0D%0A++++++++&apikey=d3419539-f429-4450-9097-8dd123acadd0&format=txt
“ \
|grep name=\"disease\”\
|sed "s/<binding name=\"disease\"><uri>/</“\
|sed "s/<\/uri><\/binding>/>/“\
|grep EFO \
|for efo in `xargs`; \
do curl "http://sparql.wikipathways.org/?default-graph-uri=&query=PREFIX+identifiers%3A%3Chttp%3A%2F%2Fidentifiers.org%2Fensembl%2F%3E%0D%0APREFIX+atlas%3A+%3Chttp%3A%2F%2Frdf.ebi.ac.uk%2Fresource%2Fatlas%2F%3E%0D%0APREFIX+atlasterms%3A+%3Chttp%3A%2F%2Frdf.ebi.ac.uk%2Fterms%2Fatlas%2F%3E%0D%0APREFIX+efo%3A+%3Chttp%3A%2F%2Fwww.ebi.ac.uk%2Fefo%2F%3E%0D%0A%0D%0ASELECT+%22$efo%22+count+%28DISTINCT+%3FwpURL%29++where+%7B%0D%0A%0D%0ASERVICE+%3Chttp%3A%2F%2Fwww.ebi.ac.uk%2Frdf%2Fservices%2Fatlas%2Fsparql%3E+%7B%0D%0A+++++%3Ffactor+rdf%3Atype+$efo+.+%0D%0A+++++%3Fvalue+atlasterms%3AhasFactorValue+%3Ffactor+.+%0D%0A+++++%3Fvalue+atlasterms%3AisMeasurementOf+%3Fprobe+.+%0D%0A+++++%3Fvalue+atlasterms%3ApValue+%3Fpvalue+.+%0D%0A+++++%3Fvalue+rdfs%3Alabel+%3FexpressionValue+.+%0D%0A+++++%3Fprobe+atlasterms%3AdbXref+%3FdbXref+.%0D%0A%7D%0D%0A+++++%3FpwElement+dcterms%3AisPartOf+%3Fpathway+.%0D%0A+++++%3Fpathway+dc%3Atitle+%3FpwTitle+.%0D%0A+++++%3Fpathway+dc%3Aidentifier+%3FwpURL+.%0D%0A+++++%3FpwElement+wp%3AbdbEnsembl+%3FdbXref+.%0D%0A%7D&format=text%2Fcsv&timeout=0&debug=on" >>/tmp/diseaseResults.txt;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment