This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bwa mem suppress loging

Hey all,

when running bwa mem from a python file using the subprocess module and capture_output=True, the log messages that bwa mem outputs while running are put into stderr resulting in an alleged error when checking if stderr is empty.

I've tried the -v option, but it hasn't changed anything. Does anyone have any tips on how to suppress the log messages or have them not go into stderr?

I'm studying bioinformatics, so this is my first time using these tools. Maybe I've just overlooked something.

Thanks in advance!

mem log stderr bwa

1 answer

Do it the same way you'd suppress STDERR in a shell command, by redirecting 2> to /dev/null. I don't recommend doing that though, whatever you're achieving by the "STDERR is empty" check needs to be accomplished using a different method, probably an exit code check.

Log in to answer this question.