Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • silentio
    Junior Member
    • Jul 2012
    • 4

    BWA aligned sam file missing "QNAME" format

    Hi all,
    I am using BWA to align pair-end read to hg19 genome.
    Command line are as follows:

    bwa aln $ref_dir/hg19 -t 4 $work_dir/${sample}_human_1.fastq.gz > $sai_dir/${sample}_1.sai
    bwa aln $ref_dir/hg19 -t 4 $work_dir/${sample}_human_2.fastq.gz > $sai_dir/${sample}_2.sai
    bwa sampe -r "@RG\tID:$sample\tLB:$sample\tSM:$sample\tPL:ILLUMINA" $ref_dir/hg19 $sai_dir/${sample}_1.sai $sai_dir/${sample}_2.sai $work_dir/${sample}_human_1.fastq.gz $work_dir/${sample}_human_2.fastq.gz | gzip > $sam_dir/$sample.sam.gz


    However, some lines in the generated sam file are missing the "QNAME" field, starting from the FLAG field directly. As a result, the downstream command such as converting sam to bam cannot be done, giving information such as "Error parsing text SAM file. Not enough fields".

    I wonder if it is the problem of bwa, or the problem of my fastq files?

    Thanks in advance for your suggestions!
  • swbarnes2
    Senior Member
    • May 2008
    • 910

    #2
    Is gzipping the .sam really the right way to make a bam?

    Try

    Code:
    bwa sampe all that stuff | samtools view -bSh - > sample.bam

    Comment

    • maubp
      Peter (Biopython etc)
      • Jul 2009
      • 1544

      #3
      Originally posted by silentio View Post
      However, some lines in the generated sam file are missing the "QNAME" field, starting from the FLAG field directly. As a result, the downstream command such as converting sam to bam cannot be done, giving information such as "Error parsing text SAM file. Not enough fields".

      I wonder if it is the problem of bwa, or the problem of my fastq files?
      Can you show us some of these bad SAM lines? Perhaps they have empty strings as the QNAME (which is bad), in which case can you look at the FASTQ file to see if that had records without an identifier?

      Comment

      • silentio
        Junior Member
        • Jul 2012
        • 4

        #4
        I found the problem. It is because of the fastq files. Normally a fastq file starts with '"@" in the ID line. However, before running bwa, I used another software to do some preprocessing, which removed the "@". After adding "@" back, all return to normal.
        Thanks for your reply anyway!

        Comment

        Latest Articles

        Collapse

        • GATTACAT
          Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by GATTACAT
          Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
          07-01-2026, 11:43 AM
        • SEQadmin2
          Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by SEQadmin2


          I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

          Here are nine questions we think about, in roughly the order they matter, before...
          06-18-2026, 07:11 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 07-02-2026, 11:08 AM
        0 responses
        8 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-30-2026, 05:37 AM
        0 responses
        12 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-26-2026, 11:10 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-17-2026, 06:09 AM
        0 responses
        54 views
        0 reactions
        Last Post SEQadmin2  
        Working...