Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pkMyt1
    Junior Member
    • Dec 2013
    • 4

    #1

    Sorted BAM read count >2x total FASTQ count

    This might be a silly question but it is bugging me and I need the answer. I have a set of paired end FASTQ files that contain about 30 million reads total. After aligning them with BWA and sorting the output with samtools, the resulting BAM file now has about 72 million reads. Why????
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

    #2
    Show us your alignment and sorting commands.

    Comment

    • fanli
      Senior Member
      • Jul 2014
      • 197

      #3
      Multiple alignments...

      Comment

      • pkMyt1
        Junior Member
        • Dec 2013
        • 4

        #4
        Both come from iterating the files in Python. The FASTQ files are read in in blocks of four lines each which is one read. This example is a MiSeq run so 30 million (15 million in each FASTQ) seems realistic. The BAM count is from

        bamfile = pysam.AlignmentFile(o['bamfile'], "rb")
        bamfile.count()
        or
        bamfile_reads = functools.reduce(lambda x, y: x + y, [eval('+'.join(l.rstrip('\n').split('\t')[2:])) for l in pysam.idxstats(o['bamfile'])])

        https://www.biostars.org/p/1890/

        or simply counting the reads as I iterate the BAM file to do my analysis.
        Last edited by pkMyt1; 05-12-2015, 08:36 AM.

        Comment

        • pkMyt1
          Junior Member
          • Dec 2013
          • 4

          #5
          Originally posted by fanli View Post
          Multiple alignments...
          So....
          Would this imply my alignment settings are keeping things I should not?

          bwa mem -a -T 25 -L '(100, 100)'

          Comment

          • dpryan
            Devon Ryan
            • Jul 2011
            • 3478

            #6
            I would imagine that the -a flag is to blame.

            Comment

            • Brian Bushnell
              Super Moderator
              • Jan 2014
              • 2709

              #7
              Originally posted by pkMyt1 View Post
              So....
              Would this imply my alignment settings are keeping things I should not?
              That depends on the goal of your experiment. What are you trying to do?

              Comment

              • pkMyt1
                Junior Member
                • Dec 2013
                • 4

                #8
                Originally posted by Brian Bushnell View Post
                That depends on the goal of your experiment. What are you trying to do?
                This is duplex exome sequencing. Very deep but only about 80 kb of capture. I did not want to lose any alignments where one read aligned and the other did not either due to a translocation or simply a sequencing error. This is why I did the -a option. Each read is uniquely tagged so I had been able to filter things in the end. This is the first time I have seen this but it is also the first time I have run a sample that I know contains many chromosomal rearrangements in the way of translocations, duplications, deletions. I will need to try and pull out some of these multiple alignments and have a look at them so I can understand what they are better.

                Comment

                • Brian Bushnell
                  Super Moderator
                  • Jan 2014
                  • 2709

                  #9
                  In that case, it sounds like considering all good alignments of the reads is probably best. The reason for all the multiple alignments is presumably that you're targeting a repetitive region.

                  Comment

                  Latest Articles

                  Collapse

                  • kinpict.com
                    Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                    by kinpict.com
                    The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
                    Today, 06:37 PM
                  • 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,...
                    10-30-2026, 06:46 AM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by SEQadmin2, 11-12-2026, 07:59 AM
                  0 responses
                  27 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 11-05-2026, 09:25 AM
                  0 responses
                  35 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 11-03-2026, 11:54 AM
                  2 responses
                  56 views
                  0 reactions
                  Last Post kinpict.com  
                  Started by SEQadmin2, 10-28-2026, 09:57 AM
                  0 responses
                  175 views
                  0 reactions
                  Last Post SEQadmin2  
                  Working...