fasta-parser
Buffer Stream parser from FASTA to JSON.
Install
Install fasta-parser
with npm:
$ npm install fasta-parser
Alternatively, just include fasta-parser.min.js
via a <script/>
in your page.
Usage
var fasta = var fastaData = '>sequence1\n\ATGCACGTCACGTCAGTACTCGTCAGTAC\n\>sequence2\n\CAGTCCTACTGCATGCATGCATGCATGCATCGATGCATGTCGACTGCATGCATGC\n' var parser = parserparserparser//=> { id: 'sequence1',// seq: 'ATGCACGTCACGTCAGTACTCGTCAGTAC' }// { id: 'sequence2',// seq: 'CAGTCCTACTGCATGCATGCATGCATGCATCGATGCATGTCGACTGCATGCATGC' }
For a more useful API, check the dependent module bionode-fasta.
Contributing
To contribute, clone this repo locally and commit your code on a separate branch.
Please write unit tests for your code, and check that everything works by running the following before opening a pull-request:
$ npm test
To test on the browser:
$ npm run test-browser# if you get "No headless browser found" do: $ npm install -g phantomjs$ rm ~/.config/browser-launcher/config.json
Please also check for code coverage:
$ npm run coverage
To rebuild and minify the module for the browser:
$ npm run build-browser
To rebuild the documentation using the comments in the code:
$ npm run build-docs
Check the issues for ways to contribute.
Contacts
Bruno Vieira <mail@bmpvieira.com> @bmpvieira
License
fasta-parser is licensed under the MIT license.
Check ChooseALicense.com for details.