karel-brinda / NanoSim-H

NanoSim-H: a simulator of Oxford Nanopore reads; a fork of NanoSim.
Other
17 stars 6 forks source link

Accept Gzip as input #10

Open mbhall88 opened 5 years ago

mbhall88 commented 5 years ago

It would maybe be useful to indicate in the README, or even have a catch when parsing CLI, that gzipped input is not accepted.

karel-brinda commented 5 years ago

Hi Michael, thanks for reporting. It might be easy to add support for gzip using https://pypi.org/project/xopen/.

mbhall88 commented 5 years ago

In my experience even just the gzip package that comes with python is fairly easy to work with https://docs.python.org/3/library/gzip.html . Saves adding an extra dependency...

niemasd commented 1 year ago

Seeing this years later (so I assume gzip input support hasn't been added), but if you're running NanoSim-H in bash, you can use a named pipe to decompress on-the-fly:

nanosim-h <(zcat reference.fas.gz)

I just tested this right now, and it worked perfectly fine using NanoSim-H v1.1.0.4

In general, named pipes are useful when using programs that don't support a specific file format, as you can just do the conversion on-the-fly