Seqanswers Leaderboard Ad

Collapse

Announcement

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

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

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


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


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

        • seqadmin
          Recent Innovations in Spatial Biology
          by seqadmin


          Spatial biology is an exciting field that encompasses a wide range of techniques and technologies aimed at mapping the organization and interactions of various biomolecules in their native environments. As this area of research progresses, new tools and methodologies are being introduced, accompanied by efforts to establish benchmarking standards and drive technological innovation.

          3D Genomics
          While spatial biology often involves studying proteins and RNAs in their...
          01-01-2025, 07:30 PM
        • seqadmin
          Advancing Precision Medicine for Rare Diseases in Children
          by seqadmin




          Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
          12-16-2024, 07:57 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 01-03-2025, 11:18 AM
        1 response
        32 views
        1 like
        Last Post Tonia
        by Tonia
         
        Started by seqadmin, 12-30-2024, 01:35 PM
        0 responses
        40 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-17-2024, 10:28 AM
        0 responses
        45 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-13-2024, 08:24 AM
        0 responses
        58 views
        0 likes
        Last Post seqadmin  
        Working...
        X