ITBE-Lab / MA

The Modular Aligner and The Modular SV Caller
MIT License
45 stars 3 forks source link

Feature request: output BAM and/or print to STDOUT #5

Closed andreaswallberg closed 4 years ago

andreaswallberg commented 4 years ago

Dear developers,

I am just trying this out with mapping PromethION data against a very large (6x larger than the human genome) and fragmented genome assembly. It seems to perform quite well. Good job!

I wonder if you could consider adding a way to either print to a BAM file, gzip the SAM file or just print to STDOUT, leaving it to the user to deal with saving the alignments (for instance by first processing it arbitrarily with samtools).

In my case, this is mostly about saving disk space but at least the latter option would make the program more easy to integrate into arbitrary pipelines.

Cheers!

dnbaker commented 4 years ago

I don't maintain this (I just follow), but have you tried -o /dev/stdout?

andreaswallberg commented 4 years ago

I don't maintain this (I just follow), but have you tried -o /dev/stdout?

facepalm

Too easy. Yes, that seems to work great actually, and other program messages do not appear to print to stdout. Many thanks!

andreaswallberg commented 4 years ago

Oops!

Turns out that it does actually print starting alignment. to STDOUT before printing the SAM sata, so some parsing is needed before piping it on. Could be that ma prints other stuff throughout the process or at the end as well, so some tweaking to the code is greatly appreciated here.

MarkusRainerSchmidt commented 4 years ago

Hi,

The starting alignment print will now go to stderr. So now, MA should not be printing anything to stdout if it is compiled in release mode (that’s the default) and no errors occur. Pipeline integration is a good point. I should move all debug prints over to stderr eventually…

Thanks, Markus