INNER CODE UNIT · JavaScript
file
lh3/minigraph · misc/mgutils.js:118
var file = new File(args[getopt.ind+1]);
var buf = new Bytes();
while (file.readline(buf) >= 0) {
const s = buf.toString();
if (s[0] != '>') {
print(buf);
} else {
var m;
if ((m = /^>(.*)/.exec(s)) != null) {
var name = m[1].replace(/^\S+#/, "");
print(">" + prefix + sep + name);
} else throw Error("Wrong FASTA format!");
}
}
file.close();
buf.destroy();
}