INNER CODE UNIT · JavaScript
mg_cmd_merge2vcf
lh3/minigraph · misc/mgutils-es6.js:93
function mg_cmd_merge2vcf(args) {
let opt = { max_allele:15, ref_index:0, fn_sample:null, sample:[] };
for (const o of getopt(args, "r:a:s:", [])) {
if (o.opt == "-r") opt.ref_index = parseInt(o.arg);
else if (o.opt == "-a") opt.max_allele = parseInt(o.arg);
else if (o.opt == "-s") opt.fn_sample = o.arg;
}
if (args.length == 0) {
print(`Usage: mgutils-es6.js merge2vcf [options] <in.bed>`);
print(`Options:`);
print(` -r INT which sample corresponds to the reference [${opt.ref_index}]`);
print(` -a INT max allele number [${opt.max_allele}]`);
print(` -s FILE list of sample names, one per line []`);
return;
}
let file, buf = new Bytes();
if (opt.fn_sample) {
file = new File(opt.fn_sample);