Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yinshe
    Member
    • Oct 2010
    • 20

    #1

    Picard fix mate information failed with bwa mem result

    Hello,

    I used the newest version of bwa mem (V0.7.12-r1039) to run alignment of pair-end sequencing data. The alignment is fine. However, since I added in read group information, and this was included into the command. So in the final sam file, at @PG line, it contains command line information (CL tag), it broke the SAM specification, which some tags in @RG lines show up in @PG lines because the command contains read group information. When I used picard to fix mate information, picard complained about this. Does anybody has some ways to work around this? Thanks!
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Can you show the relevant part of the header (ideally with a couple lines on either side)?

    Comment

    • yinshe
      Member
      • Oct 2010
      • 20

      #3
      Thanks!

      The line which causes problem is:

      @PG ID:bwa PN:bwa VN:0.7.12-r1039 CL:bwa mem -t 10 -R @RG ID:Sample1 CN:SequencingCenter DS:Project1 DT:2015-02-09 PL:ILLUMINA -M human_g1k_v37_decoy.fasta read1.fastq.gz read2.fastq.gz

      all the items after "CL:" are separated by space, except items between "@RG" and "PL:ILLUMINA" which are separated by tab, since they are read group information.

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Ah, you must be running the command from within a script where you've explicitly input tabs rather than giving a string with "\t" tab designations. Try the following directly from the command line:

        Code:
        bwa mem -t 10 -R "@RG\tID:Sample1\tSM:Sample1\tCN:SequencingCenter\tDS:Project1\tDT:2015-02-09\tPL:ILLUMINA" -M human_g1k_v37_decoy.fasta read1.fastq.gz read2.fastq.gz
        That's likely to work. Also, I added the SM tag, which picard requires. I ran into an issue like this once when I was sending commands through multiple layers of programs on a cluster. It turned out that the "\t" indicators were getting expanded to actual tabs at some point, so I had to escape things ("\\t").

        Comment

        • jmarshall
          Samtools maintainer
          • Jul 2009
          • 39

          #5
          There's a bug in bwa here: in main() in main.c it ought to sanitise argv[i] (say, by changing tabs and newlines to spaces) before adding it to the @PG header. (And similarly argv[0] really.)

          As dpryan notes, bwa will parse \t escape sequences so this would provide a workaround as \t will appear in the @PG line rather than actual tab characters. Depending on how many layers of scripting are involved, it may or may not be easy to get \t sequences to bwa without a previous layer turning them into tabs first!

          Comment

          • dpryan
            Devon Ryan
            • Jul 2011
            • 3478

            #6
            Indeed, BWA will also allow incorrect header tags like "asd:f".
            Last edited by dpryan; 03-05-2015, 05:50 AM. Reason: Not enough coffee

            Comment

            • yinshe
              Member
              • Oct 2010
              • 20

              #7
              Thanks, dpryan and jmarshall

              I have two layers of scripting. I will try to see whether it is possible to print "\t". It would be best if SAM format has some way to escape tabs in the command line.

              I tried to set "VALIDATION_STRINGENCY" as "LENIENT" in picard, it goes through with the warning. I hope the downstream tools can also accept this.
              Last edited by yinshe; 03-05-2015, 05:57 AM.

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                by SEQadmin2



                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                ...
                10-14-2026, 09:55 AM
              • SEQadmin2
                New Genomics Technologies Take Aim at Long-Standing Limits
                by SEQadmin2


                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                ...
                09-28-2026, 10:25 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 10-22-2026, 11:13 AM
              0 responses
              38 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 10:48 AM
              0 responses
              28 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-15-2026, 10:52 AM
              0 responses
              41 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-14-2026, 05:39 AM
              0 responses
              45 views
              0 reactions
              Last Post SEQadmin2  
              Working...