prevent [samopen] from being printed by samtools
2
0
Entering edit mode
9.7 years ago
shuelga ▴ 20

I am calling samtools as a subprocess from a script, many times. Each time it runs I get a message to the screen that says [samopen] SAM header is present: X sequences. I have tried to redirect it, but have not been successful. I don't see any kind of "quiet" mode option in samtools. Is there a way to make this not print every time I call samtools?

alignment subprocess samtools • 2.6k views
ADD COMMENT
2
Entering edit mode
9.7 years ago

Redirect stderr to /dev/null http://askubuntu.com/questions/350208/what-does-2-dev-null-mean

cmd 2> /dev/null
ADD COMMENT
0
Entering edit mode

Thanks for a quick response. I tried that and it didn't seem to work, although my call piped output to another call, so I just had to relocate the stderr redirect to the first call and now it works (duh). Thank you!

ADD REPLY
1
Entering edit mode
9.7 years ago

Aside from redirecting stderr to /dev/null, as Pierre mentioned, you could also just using a more recent version of samtools. I think version 0.1.19 was the last one to do this (github seems to confirm this).

ADD COMMENT
0
Entering edit mode

Oh! thanks for the tip. I will also update.

ADD REPLY

Login before adding your answer.

Traffic: 1848 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6