Closed visze closed 4 years ago
Is there a python library that is able to reliably write bgzipped files?
Have a look at manuels vcfpy:
https://github.com/bihealth/vcfpy/blob/master/vcfpy/bgzf.py
Shamelessly taken from Biopython :-)
Without -o
from . import bgzf
stream = bgzf.BgzfWriter(fileobj=stream)
with -o
from . import bgzf
if path.endswith(".gz"):
stream = bgzf.BgzfWriter(filename=path)
else:
f = open(path, "wt")
for using the program in pipelines the naming convention of positive and negative is not practical.
It would be great that the output is in 1 (one) file like the input and the user can specify it directly like:
-o myOutputFile.bed
And the -o command should be made optional. Without -o the output goes to standard out and can be piped, compressed etc...
I know that you use the standard out for messages. But here you can use the warning channel or, when -log is given, write it into a log file.
finally it would be nice if the output can be bgzipped on the fly when the user adds -g. So then we have nice commands with identical results:
And a final final request :-)
using -i and -r for input and reference to make code much clearer without looking at the help what is in the first and second position of the command. And the you the order does not matter