New API methods & Vagrant images

Additions to the API

We can announce some minor additions to our API:

  1. You can now grab annotations for a SNP by using http://opensnp.org/snps/json/annotation/$SNP_NAME.json. For example http://opensnp.org/snps/json/annotation/rs7903146.json returns all Mendeley-, PLOS- and SNPedia-annotations we have for Rs7903146.
  2. You can now get additional information for phenotypes. You can get a list of all phenotypes by visiting http://opensnp.org/phenotypes.json. You can use this call to find out the IDs of the phenotypes you are interested in. 
  3. And you can get all phenotypic variation and the description for a given phenotype by visiting http://opensnp.org/phenotypes/json/variations/$PHENOTYPE_ID.json. For example http://opensnp.org/phenotypes/json/variations/12.json gives you the variation for each user at the phenotype with the ID 12.

We also added some more extensive documentation of the API to our Wiki at GitHub. The wiki also lists the attributes each call will return.

Vagrant Image

We compiled two Vagrant-images which should make running the openSNP source and development much easier. Installing Ruby, Redis, PostgreSQL, Java, and all the right versions of the Ruby gems can be painful and often takes a significant amount of time – so we created the Vagrant-Image, which is the whole server-runtime with all gems pre-installed inside a virtual environment for easy development.  This Railscast gives you a nice idea of how to install and use Vagrant.

Our Vagrant-images (downloadable as 32 bit version and 64 bit version) are based on Lucid64 and Lucid32 and come with the Ruby version manager rbenv, Ruby 1.9.2 including bundler, Sun’s Java and Postgres 8.4 (the development-tables are already migrated) pre-installed. Getting the development-server running should now be really easy:

  1. Install the image using vagrant box add opensnp http://opensnp.org/opensnp32.box
  2. Initialize the image inside your openSNP-folder using vagrant init opensnp
  3. Run vagrant up to start your image and afterwards connect to it using vagrant ssh
  4. Go to the mounted directory using cd /vagrant
  5. Run bundle to see if all gems are working as expected and try bundle exec rails s to start the web-server

You can watch this Railscast to learn more about how you can put Vagrant to use and download our Vagrant-image as 32bit version or 64bit version. One caveat: You need to delete the .rvmrc file if you want to run vagrant from inside the directory which has your copy of the openSNP-source code. The file can be found in the root-folder of the openSNP-source code. If you keep the file your copy of RVM might lead to some problems with vagrant. Let us know if you encounter any problems or need help.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: