Genbank ID checker/converter API - DOWN as of 2016-11-27
Ruby Nginx Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.ruby-version
Gemfile
Gemfile.lock
LICENSE.md
README.md
Rakefile
api.rb
config.ru
config.yaml
config_sac_local.yaml
dataprep.rb
dataprep.sh
fetchdata.sh
model.rb
nginx.conf
oldcode.rb
redis-6379.conf
redis-6380.conf
unicorn.conf
unicorn.rb
utils.rb

README.md

Genbank ID checker/converter API

Service is down as of 2016-11-27

API Status: http://recology.info/gbidsstatus (source for status page)

API Docs: http://recology.info/gbidsdocs (in progress)

Under the hood

  • API: Ruby/Sinatra
  • Storage: MySQL
  • Caching: Redis
    • each key cached for 3 hours
  • Server: Caddy
    • https
  • Authentication: none

  • Instance: EC2,

Will soon have a cron job update when new dump is available every Sunday, but for now we're about a month behind the current dump of identifiers.

base url

https://gbids.xyz

API Endpoints

  • / re-routes to /heartbeat
  • /heartbeat - list routes
  • /acc - GET - list accession ids
  • /acc/:id,:id,... - GET - submit many accession numbers, get back boolean (match or no match)
  • /acc - POST
  • /gi - GET - list gi numbers
  • /gi/:id,:id,... - GET - submit many gi numbers, get back boolean (match or no match)
  • /gi - POST
  • /acc2gi/:id,:id,... - GET - get gi numbers from accession numbers
  • /acc2gi - POST
  • /gi2acc/:id,:id,... - GET - get accession numbers from gi numbers
  • /gi2acc - POST

start

start Redis

sudo redis-server /etc/redis-6379.conf

Load data

  • downloading data from NCBI FTP server first...takes a while
  • uncompress files
  • mysql stuff...

Example

using curl and jq

curl 'https://gbids.xyz/heartbeat' | jq .
{
  "routes": [
    "/heartbeat",
    "/acc/:accessions (GET)",
    "/acc (POST)",
    "/gi/:gi_numbers (GET)",
    "/gi (POST)",
    "/acc2gi/:accessions (GET)",
    "/acc2gi (POST)",
    "/gi2acc/:gi_numbers (GET)",
    "/gi2acc (POST)"
  ]
}
curl 'https://gbids.xyz/acc/AACY024124486,AACY024124483,asdfd,asdf,AACY024124476' | jq .
{
  "matched": 3,
  "returned": 5,
  "data": {
    "AACY024124486": true,
    "AACY024124483": true,
    "asdfd": false,
    "asdf": false,
    "AACY024124476": true
  },
  "error": null
}
curl -XPOST 'https://gbids.xyz/acc' -F ids='AACY024124486,AACY024124483,asdfd,asdf,AACY024124476' | jq .
{
  "matched": 3,
  "returned": 5,
  "data": {
    "AACY024124486": true,
    "AACY024124483": true,
    "asdfd": false,
    "asdf": false,
    "AACY024124476": true
  },
  "error": null
}
curl 'https://gbids.xyz/gi/129566194,129566187,129566184,asdfafd' | jq .
{
  "matched": 3,
  "returned": 4,
  "data": {
    "129566194": true,
    "129566187": true,
    "129566184": true,
    "asdfafd": false
  },
  "error": null
}
curl 'https://gbids.xyz/acc2gi/AACY024124486,AACY024124483,asdfd,asdf,AACY024124476' | jq .
{
  "matched": 3,
  "returned": 5,
  "data": [
    {
      "accession": "AACY024124476",
      "gi": 129566194
    },
    {
      "accession": "AACY024124483",
      "gi": 129566187
    },
    {
      "accession": "AACY024124486",
      "gi": 129566184
    },
    {
      "accession": "asdfd",
      "gi": null
    },
    {
      "accession": "asdf",
      "gi": null
    }
  ],
  "error": null
}
curl 'https://gbids.xyz/gi2acc/129566194,129566187,129566184' | jq .
{
  "matched": 3,
  "returned": 3,
  "data": [
    {
      "accession": "AACY024124486",
      "gi": 129566184
    },
    {
      "accession": "AACY024124483",
      "gi": 129566187
    },
    {
      "accession": "AACY024124476",
      "gi": 129566194
    }
  ],
  "error": null
}