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?
redirect stderr to /dev/null http://askubuntu.com/questions/350208/what-does-2-dev-null-mean
cmd 2> /dev/null
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).