Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!

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

    Comment


    • #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


      • #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


        • #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


          • #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


            • #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

              • seqadmin
                Essential Discoveries and Tools in Epitranscriptomics
                by seqadmin


                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                Yesterday, 07:01 AM
              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              55 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              51 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              45 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              55 views
              0 likes
              Last Post seqadmin  
              Working...
              X