Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to output bamUtil stats to STDOUT rather than to a file #44

Closed
dylkot opened this issue Jul 27, 2017 · 2 comments
Closed

Option to output bamUtil stats to STDOUT rather than to a file #44

dylkot opened this issue Jul 27, 2017 · 2 comments

Comments

@dylkot
Copy link

dylkot commented Jul 27, 2017

Hi There,

I am using bamUtil stats to analyze some whole-genome sequencing data like so

curl url_for_my_large_bam.bam | ./bam stats --in -.ubam --cBaseQC results.txt

and results.txt is really large. I would love to be able to pipe it to awk to do some filtering. It seems like it would be pretty easy to add an option to write to STDOUT. Is this an option I am missing or would it be possible to add?

Thanks,
Dylan

@pjvandehaar
Copy link
Contributor

pjvandehaar commented Jul 27, 2017

curl url_for_my_large_bam.bam | ./bam stats --in -.ubam --cBaseQC -

works for me. I just added - to bam stats --help in the commit eb54217 .

In general, any time that you want to pipe something to stdout using a filename, you can use /dev/fd/1. Example:

curl url_for_my_large_bam.bam | ./bam stats --in -.ubam --cBaseQC /dev/fd/1 2>/dev/null | cut -f1 | uniq -c

(The 2>/dev/null discards the line Number of records read = 10000.)

@dylkot
Copy link
Author

dylkot commented Jul 27, 2017

HI pjvandehaar, thank you for the tip! I will use that.

@mktrost mktrost closed this as completed Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants