1.0.0 • Published 9 years ago

level-dna v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

level-dna

NPM

Import genome data (json format) into LevelDB.

Example

Example of importing the dna of contra into level.

var fs = require('request')
var JSONStream = require('JSONStream')
var levelup = require('levelup')
var tolevel = require('level-dna')

var db = levelup('./contra')

request('https://github.com/contra/dna/blob/master/dna.json?raw=true')
  .pipe(JSONStream.parse('*'))
  .pipe(tolevel(db))

The format will turn

{"id":"rs4477212","c":1,"pos":82154,"g":"AA"}

into

{"key":"rs4477212","value": "AA"}

So it will only save the genotype and the RSID. If you think you also need the other information, feel free to create an issue/pull request.