Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepsea
    Member
    • Jan 2010
    • 12

    #1

    htseq-count gets more reads?

    Hi,

    My sam file had been sorted by read names using 'samtools sort -n'. Then I used htseq-count to count reads in this sam file; I also double checked by counting unique read names using awk/uniq/wc. The sum of htseq-count output is larger than the number of unique read names. How can this happen? htseq-count count some reads multiple times? Thanks for any hints!
  • ffinkernagel
    Senior Member
    • Oct 2009
    • 110

    #2
    My guess: you have reads that were mapped to multiple locations, and htseq doesn't remove duplicates.

    You should get the same count if you drop the uniq form your command line (which amounts just to samtools view | wc -l, I guess)

    Comment

    • chadn737
      Senior Member
      • Jan 2009
      • 392

      #3
      How did you sum up the htseq-count output? Because at the end of the htseq-count output you get these categories:

      no_feature
      ambiguous
      too_low_aQual
      not_aligned
      alignment_not_unique

      The last category is the number of reads with multiple hits, if you simply summed up all your output, without disregarding this last category then its going to be larger.

      Comment

      • deepsea
        Member
        • Jan 2010
        • 12

        #4
        Thanks for the responses, guys!

        I think I find the reason. The number of 'alignment_not_unique' is not what I expected.

        First of all, my understanding is the reads with multiple hits are not counted in any genes.

        So if it is true, and if 'alignment_not_unique' is the number of reads with multiple hits, the sum of reads mapped in genes (uniquely), reads not in genes (uniquely), ambiguous, multiple hits will be exact the total number in the SAM file.

        What I did is: using 'NH:i' tag, I separated alignments into two sam files, one is unique mappings (NH:i:1), the other is multiple hits (NH:i:n, n>1). Then ran htseq-count on both, and counted the unique read IDs in both sam files.

        In total, I have 12.8M reads, 11.9M in the unique mapping sam, 0.9M in the other sam.

        In the htseq-count of the unique sam, the 'alignment_not_unique' category is 0, and the sum of all genes and other categories is 11.8M (very close to 11.9, I am satisfied with it).

        In the htseq-cout of the other sam, all other genes and categories are 0, and the 'alignment_not_unique' category is 2.8M. Remember that sam has 0.9M unique read IDs, and 4.1M lines.

        So my conclusions:

        1. reads won't be count multiple times; if they cannot be uniquely mapped, they are counted in some categories.

        2. the numbers of genes and other categories are the number of reads; but the number of 'alignment_not_unique' is neither the number of reads nor the number of alignments. (my data is pair-end sequencing.)

        The reason I need these numbers is that I want to understand the RNA compositions (proportions of different regions), which is useful when comparing different biological samples.

        Right now, I take all numbers in htseq-count output except 'alignment_not_unique', then add the number of unique IDs with NH:i:n tag, the sum is (almost) what I expected.

        Simon, if you read this thread, do you think it is good to make this number is also a number of reads, so the whole output is consistent?

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
          by SEQadmin2



          CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

          Despite this, “CRISPR helped turn genome editing from a specialized technique into
          ...
          07-31-2026, 11:01 AM
        • SEQadmin2
          Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
          by SEQadmin2


          Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

          The systematic characterization of the human proteome has
          ...
          07-20-2026, 11:48 AM
        • SEQadmin2
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 07-31-2026, 02:55 AM
        0 responses
        18 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-24-2026, 12:17 PM
        0 responses
        16 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-23-2026, 11:41 AM
        0 responses
        16 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-20-2026, 11:10 AM
        0 responses
        26 views
        0 reactions
        Last Post SEQadmin2  
        Working...