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
                16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                by SEQadmin2




                NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
                Today, 06:46 AM
              • 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

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 10-28-2026, 09:57 AM
              0 responses
              22 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-28-2026, 09:51 AM
              0 responses
              15 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 11:13 AM
              0 responses
              68 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 10:48 AM
              0 responses
              48 views
              0 reactions
              Last Post SEQadmin2  
              Working...