fastqstream
v0.1.0
Published
A stream transform to convert text to FASTQ records
Downloads
15
Readme
fastqstream
fastqstream is a Stream transform for parsing FASTQ files into records.
Usage
var fs = require('fs')
var reader = fs.createReadStream('file.fq')
reader.pipe(new FASTQStream())
.on('data', function (data) {
console.log(data)
})
Available transforms
There are two transforms available:
- FASTQStream takes a String or Buffer and convert into Records (as objects). It does some basic validation on the syntax, but doesn't try to verify if quality scores are valid, for example.
- FASTQValidator implements more strict validation,
such as checking that no sequence in the original FASTQ has the same
id
as other sequences.
Alternatives
I checked for FASTQ parsers on NPM but none had all the features that I wanted.
They are all very interesting,
but I wanted something that works on any stream and is agnostic about nodejs or browser.
Most of them implement the parser as a Readable stream (expecting a path,
which it then opens with fs
),
but I think it is better to implement it as a Transform and consume data from whatever is piping data in.
- https://www.npmjs.com/package/fasta-tools
- https://www.npmjs.com/package/fqreader
- https://www.npmjs.com/package/bionode-fastq
- https://www.npmjs.com/package/streaming-sequence-extractor Focuses on GenBank files, but many nice ideas here.
License
BSD 3-clause