fqreader

reads FASTQ files

fqreader

fqreader reads FASTQ files.

$ npm install fqreader

call it like this

var fqreader = require("fqreader");
fqreader.read(filename, function(data) {
  console.log(data.id);
  console.log(data.seq);
  console.log("+");
  process.stdout.write(data.qual + "\n"); // to avoid %% -> %. or use consolog (https://github.com/shinout/consolog) 
});

or like this

var fqreader = require("fqreader");
fqreader.read(filename, 
  datafunction(data) {
    console.log("on data", data);
  },
  endfunction() {
    console.log("on end");
  }
});

Reads file with its name fastqfile as fastq format.

fastqfile is a filename or a readable stream like process.stdin.

if fastqfile is "-", then it reads from processs.stdin.

params is required, must be an object or a function.

params.data is called for each fastq unit with data.

  • data.id : sequence id
  • data.seq : sequence
  • data.qual : quality values

params.end is called after the file is read through.

other values in params is used for fs.createReadStream(fastqfile, params)

for example, highWaterMark can be useful for performancd tuning.

are callable in "data" function

var fqreader = require("fqreader");
fqreader.read(filename, 
  datafunction(data) {
    this.pause();
 
    var _this = this
    setTimeout(function() {
      _this.resume();
    }, 10);
  }
 
});