This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there any way to avoid adding the PG tag while creating a SAM output from BWA ?

Hi

Is there any way to avoid adding the PG tag while creating a SAM output from BWA ? The only option I could think of is to use samtools reheader and adding a new header without the PG tag. I am wondering if that would be possible during the mapping step itself.

bwa sam pg

1 answer

You can pipe the output through grep and use grep -v @PG, but the question then becomes why you would actually want to do that. It's usually best to keep that information in there in case you need it down the line.

Yep, I also suggest to keep it in case you mislable the file accidentlly so this entry might help you figuring out what the file actually contains and how it was created.

Log in to answer this question.