bionode-bwa
Advanced tools
Comparing version 0.0.2 to 0.0.4
{ | ||
"name": "bionode-bwa", | ||
"description": "A Node.js wrapper for the Burrow-Wheeler Aligner (BWA).", | ||
"version": "0.0.2", | ||
"version": "0.0.4", | ||
"homepage": "http://github.com/bionode/bionode-bwa", | ||
@@ -21,14 +21,17 @@ "repository": { | ||
"devDependencies": { | ||
"mocha": "~1.21.3", | ||
"mocha-lcov-reporter": "0.0.1", | ||
"should": "~4.0.4", | ||
"async": "~0.9.0", | ||
"coveralls": "~2.11.1", | ||
"docco": "~0.6.3", | ||
"istanbul": "~0.3.0", | ||
"coveralls": "~2.11.1", | ||
"async": "~0.9.0", | ||
"request": "~2.39.0", | ||
"tool-stream": "0.0.1", | ||
"tap-spec": "^1.0.0", | ||
"tape": "^3.0.0", | ||
"testling": "^1.7.1", | ||
"through2": "~0.5.1", | ||
"docco": "~0.6.3" | ||
"tool-stream": "0.0.1" | ||
}, | ||
"keywords": [ | ||
"bio", | ||
"biology", | ||
"bionode", | ||
"bioinformatics", | ||
@@ -47,3 +50,3 @@ "aligner", | ||
"preinstall": "git clone https://github.com/lh3/bwa.git; cd bwa; git checkout 0.7.10; make", | ||
"test": "mocha --reporter spec; rm test/reference.*; rm test/reads.*; rm test/alignment.sam", | ||
"test": "node test/bionode-bwa.js | tap-spec && rm test/reference.* && rm test/reads.* && rm test/alignment.sam", | ||
"build-docs": "docco ./lib/bionode-bwa.js", | ||
@@ -50,0 +53,0 @@ "coverage": "istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec && rm -rf ./coverage; rm test/reference.*; rm test/reads.*; rm test/alignment.sam", |
@@ -5,32 +5,28 @@ var bwa = require('../') | ||
var request = require('request') | ||
var should = require('should') | ||
var tool = require('tool-stream') | ||
var through = require('through2') | ||
var async = require('async') | ||
var test = require('tape') | ||
require('mocha') | ||
describe("Align reads to reference with BWA", function() { | ||
this.timeout(6000000); | ||
test("Align reads to reference with BWA", function (t) { | ||
t.plan(2) | ||
var referencePath = 'test/reference.fasta.gz' | ||
var readsPath = 'test/reads.fastq.gz' | ||
var alignmentPath = 'test/alignment.sam' | ||
var referenceURL = 'http://ftp.ncbi.nlm.nih.gov/genbank/genomes/Eukaryotes/protozoa/Guillardia_theta/Guith1/Primary_Assembly/unplaced_scaffolds/FASTA/unplaced.scaf.fa.gz' | ||
var readsURL = 'http://ftp.sra.ebi.ac.uk//vol1/fastq/SRR070/SRR070675/SRR070675.fastq.gz' | ||
it("should take paths for reference, reads and aligment. Reference should be indexed first.", function(done) { | ||
var referenceURL = 'http://ftp.ncbi.nlm.nih.gov/genbank/genomes/Eukaryotes/protozoa/Guillardia_theta/Guith1/Primary_Assembly/unplaced_scaffolds/FASTA/unplaced.scaf.fa.gz' | ||
var readsURL = 'http://ftp.sra.ebi.ac.uk//vol1/fastq/SRR070/SRR070675/SRR070675.fastq.gz' | ||
var downloads = [ | ||
download(referenceURL, referencePath), | ||
download(readsURL, readsPath) | ||
] | ||
async.parallel(downloads, alignReadsToRef) | ||
var downloads = [ | ||
download(referenceURL, referencePath), | ||
download(readsURL, readsPath) | ||
] | ||
async.parallel(downloads, alignReadsToRef) | ||
function alignReadsToRef() { | ||
var mem = bwa() // default to mem | ||
mem([referencePath, readsPath, alignmentPath]) | ||
.on('data', function(data) { checksum(data, '3dae171586e8f5fda2737795ff2e39df711701cb', done) }) | ||
} | ||
}) | ||
function alignReadsToRef() { | ||
var msg = "should take paths for reference, reads and aligment. Reference should be indexed first." | ||
var mem = bwa() // default to mem | ||
mem([referencePath, readsPath, alignmentPath]) | ||
.on('data', function(data) { checksum(data, '3dae171586e8f5fda2737795ff2e39df711701cb', msg, t) }) | ||
it("should align using a Stream that takes arrays of paths for reference and reads.", function(done) { | ||
var msg = "should align using a Stream that takes arrays of paths for reference and reads." | ||
var mem = bwa('mem -x pacbio') | ||
@@ -40,4 +36,4 @@ var memStream = mem() // we will pass arguments with write | ||
memStream.end() | ||
memStream.on('data', function(data) { checksum(data, 'a2ac465ac0d9e0879a9f9a43108e36b682f2e018', done) }) | ||
}) | ||
memStream.on('data', function(data) { checksum(data, 'a2ac465ac0d9e0879a9f9a43108e36b682f2e018', msg, t) }) | ||
} | ||
}) | ||
@@ -56,3 +52,3 @@ | ||
function checksum(data, hash, cb) { | ||
function checksum(data, hash, msg, t) { | ||
if (['index', 'aln'].indexOf(data.operation) === -1 && data.status === 'finished') { | ||
@@ -64,6 +60,5 @@ var alignmentFile = fs.createReadStream(data.sam) | ||
var sha1 = shasum.digest('hex'); | ||
sha1.should.eql(hash) | ||
cb() | ||
t.equal(sha1, hash, msg) | ||
}) | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
0
100
401359
21
1015