Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seru
    Junior Member
    • Aug 2011
    • 2

    #1

    bwa outputs bam with less reads than in input fastq

    I downloaded a publicly available bam file and ran samtools flagstat on it. The output is here:

    482805326 + 0 in total (QC-passed reads + QC-failed reads)
    0 + 0 duplicates
    235328156 + 0 mapped (48.74%:nan%)
    482805326 + 0 paired in sequencing
    241402663 + 0 read1
    241402663 + 0 read2
    235328156 + 0 properly paired (48.74%:nan%)
    235328156 + 0 with itself and mate mapped
    0 + 0 singletons (0.00%:nan%)
    0 + 0 with mate mapped to a different chr
    0 + 0 with mate mapped to a different chr (mapQ>=5)

    Next, I extracted reads from the bam into two fasta files. The sum of reads in both was 482805326, so equal as in the bam. I aligned the fastq files again (bwa aln and bwa sampe), and ran samtools flagstat on the resulting bam. Here is the output:

    387280125 + 0 in total (QC-passed reads + QC-failed reads)
    0 + 0 duplicates
    387280125 + 0 mapped (100.00%:nan%)
    387280125 + 0 paired in sequencing
    194031131 + 0 read1
    193248994 + 0 read2
    375578347 + 0 properly paired (96.98%:nan%)
    381759377 + 0 with itself and mate mapped
    5520748 + 0 singletons (1.43%:nan%)
    5108005 + 0 with mate mapped to a different chr
    4124551 + 0 with mate mapped to a different chr (mapQ>=5)

    And what I don't understand is where is almost 100M reads gone? I haven't found any information on bwa removing unmapped/bad quality/duplicate reads, so I am wondering. Any hints?

    I am using bwa 0.5.9-r16
    Last edited by seru; 03-06-2012, 03:07 AM. Reason: added tool version
  • Guest

    #2
    Same here

    I have this same problem. Did you ever figure out how to fix it?

    Update: The missing reads in the bam file were due to the following error:
    [bwa_sai2sam_pe_core] print alignments... [E::sam_parse1] CIGAR and query sequence are of different length
    [W::sam_read1] parse error at line 11261615
    [main_samview] truncated file.

    All of this happened after I switched to a new reference genome (mm10). I'm not getting the error with mm9. I don't have a good explanation but I think that the version of mm10 I tried to use must have been somehow corrupted.
    Last edited by Guest; 11-05-2016, 03:37 AM.

    Comment

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #3
      Note the "100%" mapped metric, which means that the unmapped reads were excluded from the output.

      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
      14 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      67 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      47 views
      0 reactions
      Last Post SEQadmin2  
      Working...