Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • bbl
    Member
    • Jul 2010
    • 16

    samtools sorting issue or HTSeq-count problem?

    Hello all,

    This has puzzled me for days and I couldnt find any explanation on the internet.
    I noticed HTSeq-count gives the reads counts of a gene as 0. But when viewed in IGV with the accepted_hits.bam from tophat2 alignment, there are hundreds to thousands reads aligned in that gene region (from different samples).

    This is how I used HTSeq-count from HTSeq/0.6.1p1 and samtools/1.1
    samtools sort -T tmp -o accepted_hits_nsort.bam -n accepted_hits.bam
    htseq-count --format=bam --strand=no --order=name -a 5 --mode=union accepted_hits_nsort.bam Homo_sapiens.GRCh37.72.gtf > htseq_count_0.6.txt

    However, when I break down the accepted_hits.bam and extract the chromosome where the gene is, HTSeq-count gives the right reads counts for this BAM file.

    My accepted_hits.bam contains 60,845,216 alginemnt using samtools view -c accepted_hits.bam. I dont think for PE RNA-seq, file at size of 4.5G would be a problem for samtools or HTSeq-count to deal with?

    My suspicions are:
    1. samtools name sort problem
    2. htseq-count bug
    3. out of memory

    Could any one give any hint here? Any suggestion would be appreciated. Thanks.
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Try using the -o option and see what happens to some of those reads that should be getting counted.

    BTW, featureCounts is MUCH faster, which is especially convenient on larger files.

    Comment

    • kmcarr
      Senior Member
      • May 2008
      • 1181

      #3
      What gene are you looking at in IGV? The most likely answer is that you are looking at a duplicated gene and the 100's to 1000's of reads which map to it also map to the other copies elsewhere in the genome. When a read maps to multiple locations HTSeq-count will not count it for any of the genes it maps to, rather it will be be counted among the 'alignment_not_unique'. Your experiment of running HTSeq-count on just one chromosome shows that the additional mappings for these reads fall on other chromosomes. When HTSeq-count is given an incomplete alignment set with only one valid mapping for these reads it will naturally count them for that one alignment. This demonstrates why it is a bad idea to perform read counting on only partial alignment sets, unless you are prepared to deal with these types of situations.

      If you want to confirm this identify one of the reads aligned to the gene you have identified in IGV and then search for that read name in your accepted_hits.bam to see if it is multiply mapped.

      Comment

      • bbl
        Member
        • Jul 2010
        • 16

        #4
        Originally posted by dpryan View Post
        Try using the -o option and see what happens to some of those reads that should be getting counted.

        BTW, featureCounts is MUCH faster, which is especially convenient on larger files.
        Thanks very much dpryan. I shall try featureCounts too.

        Comment

        • bbl
          Member
          • Jul 2010
          • 16

          #5
          Thanks very much kmcarr. Indeed what you suspected is what happens!
          1st, CEBPA is the gene I'm intereted. From samout by HTSeq-count, reads are mapped to two and three different genes incl. CEBPA. Therefore, they are counted as ambiguous. Actually these reads are also mapped to 1. 'retired' gene, 2. antisense in my .gff ref downloaded from Ensembl.
          Since I'm looking at RNAseq samples treated using polyA+tail , I suppose it makes sense to 'manually' modify the .gff ref? For example, remove those pseudogenes, non-coding RNA etc...Would you suggest some way to modify it to be more suitable, if it is a right thing to do?

          Many thanks again.

          Comment

          Latest Articles

          Collapse

          • 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
          • SEQadmin2
            Cancer Drug Resistance: The Lingering Barrier to Rising Survival
            by SEQadmin2



            Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

            There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
            07-08-2026, 05:17 AM
          • GATTACAT
            Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
            by GATTACAT
            Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
            07-01-2026, 11:43 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 07-13-2026, 10:26 AM
          0 responses
          27 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-09-2026, 10:04 AM
          0 responses
          37 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-08-2026, 10:08 AM
          0 responses
          24 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-07-2026, 11:05 AM
          0 responses
          34 views
          0 reactions
          Last Post SEQadmin2  
          Working...