This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Missing @Pg Header In Bwa Alignment

Hi All,

I am using BWA Version: 0.7.5a-r405 for alignment. The output sam file has only @SQ lines in the header. The @PG line is missing. For now I added the line manually, but I was wondering if there is a way that the aligner can output the @PG line by itself in the sam file.

Thanks for your help.

bwa

2 answers

Strange, I'm looking a the souces of bwa-0.7.5a: and book sampe/samse sources have a call to bwa_print_sam_PG()

void bwa_print_sam_PG()
{
    err_printf("@PG\tID:bwa\tPN:bwa\tVN:%s\n", PACKAGE_VERSION);
}

and as far as I can see err_printf writes to stdout...

update : the PG flag was added after vr405:

http://sourceforge.net/p/bio-bwa/code/51/tree//trunk/bwa/main.c?diff=43

+void bwa_print_sam_PG()
+{
+    printf("@PG\tID:bwa\tPN:bwa\tVN:%s\n", PACKAGE_VERSION);
+}
+

Hi, I'm brand new to this community and I'm also brand new to bioinformatics so I apologize if this is considered as resurrecting an old thread but it's exactly the problem I'm having. I'm afraid I don't understand the answer, does it mean that I have an outdated version of bwa installed, which doesn't include the @PG line? Unlike, is327 I don't have the knowledge or experience to manually add the header.

Thanks :)

But for some reason it is not written on the sam file.

Thanks.

Log in to answer this question.