INNER CODE UNIT · JavaScript
t
lh3/minigraph · misc/mgutils-es6.js:112
const t = buf.toString().split(/\s+/);
opt.sample.push(t[0]);
}
file.close();
}
file = new File(args[0]);
let hdr = [];
hdr.push(`##fileformat=VCFv4.2`);
hdr.push(`##ALT=<ID=CNV,Description="description">`);
hdr.push(`##FORMAT=<ID=GT0,Number=1,Type=String,Description="Original genotype">`);
for (let i = 1; i <= opt.max_allele; ++i)
hdr.push(`##ALT=<ID=X:${i},Description="Allele ${i}">`);
let n_sample = opt.sample.length;
while (file.readline(buf) >= 0) {
let line = buf.toString();
if (line[0] == "#" && line[1] == "#") {
hdr.push(line);
} else if (line[0] == '#') {