Skip to content

Instantly share code, notes, and snippets.

View malonge's full-sized avatar

Michael Alonge malonge

View GitHub Profile
@lh3
lh3 / paf2sam.js
Created August 23, 2016 17:23
Preliminary and incomplete PAF->SAM converter (for wgsim_eval.pl)
var getopt = function(args, ostr) {
var oli; // option letter list index
if (typeof(getopt.place) == 'undefined')
getopt.ind = 0, getopt.arg = null, getopt.place = -1;
if (getopt.place == -1) { // update scanning pointer
if (getopt.ind >= args.length || args[getopt.ind].charAt(getopt.place = 0) != '-') {
getopt.place = -1;
return null;
}
if (getopt.place + 1 < args[getopt.ind].length && args[getopt.ind].charAt(++getopt.place) == '-') { // found "--"