Skip to content

Instantly share code, notes, and snippets.

@arq5x
Last active July 23, 2019 00:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arq5x/6322734 to your computer and use it in GitHub Desktop.
Save arq5x/6322734 to your computer and use it in GitHub Desktop.
Example use of a RESTful API to GEMINI databases.

Load a GEMINI database from a VCF

$ gemini load -v nobel.vcf -t VEP --cores 23 -p samples.ped nobel.db

Launch the GEMINI web server

(this will run on your local machine on port 8088)

$ gemini browser nobel.db

Make query requests by pointing to localhost:8088/query_json

$ curl -X GET localhost:8088/query_json?query=select+chrom%2C+start%2C+end+from+variants+limit+10
{"gemini_results": [{"chrom": "chr1", "start": 10067, "end": 10069}, {"chrom": "chr1", "start": 10230, "end": 10231}{"chrom": "chr1", "start": 12782, "end": 12783}, {"chrom": "chr1", "start": 13109, "end": 13110}, {"chrom": "chr1", "start": 13115, "end": 13116}, {"chrom": "chr1", "start": 13117, "end": 13118}, {"chrom": "chr1", "start": 13272, "end": 13273}, {"chrom": "chr1", "start": 13301, "end": 13302}, {"chrom": "chr1", "start": 13416, "end": 13417}, {"chrom": "chr1", "start": 13417, "end": 13418}]}

Or, in a browser

https://dl.dropboxusercontent.com/u/515640/gemini-REST.png

Obviously, if you can programmatically create REST requests, than you can interact programatically with a GEMINI server.

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