Description
Inclusion of literal tab characters in the bwa command line (notably, when passing a @rg read group line) leads to inclusion of literal tab characters in the @rg portion of the CL: field within the @pg line written in the SAM header. Tab control characters within fields (instead of as field separators) violates the SAM spec, and causes downstream htslib / htsjdk to choke.
See the issue I filed with htsjdk here (although the fix should ultimately be a bwa update):
samtools/htsjdk#677
This could be fixed in a couple of different ways, including (1) forbidding tab characters and (2) rewriting the CL field of the @pg line. For simplicity and cliarity sake, I vote to forbid the literal tab characters. Rewriting the @pg line does not tell the true story of the actual command line passed to bwa, which could be argued also violates the spec.
Anyway, I fixed this and a pull request is incoming.