node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

myvariantjs

myvariantjs

A NodeJS client for MyVariant.info web services

Version Node version Build Status Coverage Status myvariant-badge

MyVariant.info MyGene.info

Demo App

You can view a basic web app demo which uses the myvariantjs lib.

You can also clone and start the demo app locally. Repo is here.

Developed enterly in Chrome. Mileage may vary in other untested browsers right now (sorry 'bout that, not enough hours in my day).

Intro

MyVariant.Info provides simple-to-use REST web services to query/retrieve genetic variant annotation data. It is designed for simplicity and performance.

myvariantjs is an easy-to-use node.js client that accesses the MyVariant.Info web services.

There is also a similarly designed python client called myvariant.py, if python is your thing.

Installation

npm install myvariantjs --save

Usage

Also see the API section below.

$ node
> let mv = require('myvariantjs').default
> mv
{ url: 'http://myvariant.info/v1/',
  validFormats: [ 'json', 'csv', 'tsv', 'table', 'flat' ],
  passthru: [Function: passthru],
  getfields: [Function: getfields],
  getvariant: [Function: getvariant],
  getvariants: [Function: getvariants],
  query: [Function: query],
  querymany: [Function: querymany] }
> let got = mv.getvariant('chr9:g.107620835G>A', {fields:'dbnsfp.genename'});   //Promised 
> got.then(function(res) { console.log(res) })
> { _id: 'chr9:g.107620835G>A',
  _version: 1,
  dbnsfp: { genename: 'ABCA1' } }

API

api and usage docs

Testing

npm test

not browserified.

Build Docs

npm run doc

optional. you can view the docs in the docs folder or on github.

Todo

  • add tests for querymany
  • add fetchall
  • add facets ?
  • add sorting
  • add 'Feelin Lucky' search => full text search, needs backend support or full query parsing

Release History

  • 1.0.0 - Initial release
  • 1.0.1 - Add tests for query()
  • 1.0.2 - api doc touchups

Contact

@larryhengl

MIT license © Larry Hengl