Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fernas
    Member
    • Apr 2013
    • 74

    #1

    Count the Number of Paired-End Reads Mapped by Tophat

    Dear all,

    My paired end reads were mapped using Tophat 2.0.8. Suppose that original number of reads before mapping were (X) reads. I want to find out how many reads (Y) out of the total reads X that have been mapped by Tophat. (Y should include paired-end reads having both reads mapped, or any part of the pair that has been mapped).

    I found in the other threads the following command:

    samtools view accepted_hits.bam| cut -f 1 | sort | uniq | wc -l

    However, this works well for the single-end reads. I am wondering if this works also for paired-end reads. In order to check this, I run:

    samtools view accepted_hits.bam| cut -f 1 | sort | uniq > a
    samtools view unmapped.bam| cut -f 1 | sort | uniq > b
    comm -12 <(cat a) <(cat b) > c

    and then I found that (length of a + length of b) - length (c) almost equals the original number of reads.

    I am wondering if this is correct to report the percentage of mapped reads for paired-end reads?
  • swbarnes2
    Senior Member
    • May 2008
    • 910

    #2
    Good grief. You are making this way too difficult. Do you even understand what that command line does?

    If you have samtools, just run samtools flagstat!

    Comment

    • Fernas
      Member
      • Apr 2013
      • 74

      #3
      swbarnes2,
      samtools flagstat does not give what I want. It reports only mapped read (and mapped pairs). if one read is mapped twice or each of pair reads mapped to different chromosome, it will be counted as 2. However, as I explained above, I want to get the total number of mapped reads (each paired-read is counted one time only).

      I wrote the commands in my previous post!

      Comment

      • sidderb
        Member
        • Aug 2011
        • 14

        #4
        Have you tried Picard's CollectAlignmentSummaryMetrics & CollectRnaSeqMetrics?

        http://picard.sourceforge.net/comman...SummaryMetrics
        @sidderb

        Comment

        • ClemBuntu
          Member
          • Dec 2014
          • 37

          #5
          Hello,
          I got exactly the same problem, and CollectAlignmentSummaryMetrics doesn't seem to work very well for paired ends reads ; http://seqanswers.com/forums/showthread.php?t=63578

          any idea someone ?

          Comment

          • Brian Bushnell
            Super Moderator
            • Jan 2014
            • 2709

            #6
            Well...

            If you map reads with BBMap, it will tell you exactly how many were mapped, and how many were properly paired.

            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
            23 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-28-2026, 09:51 AM
            0 responses
            15 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 11:13 AM
            0 responses
            68 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 10:48 AM
            0 responses
            48 views
            0 reactions
            Last Post SEQadmin2  
            Working...