Question: HTseq does not generate any counts file
gravatar for archisman
3 days ago by
archisman0 wrote:

Here is my code for generating counts from the BAM file.

bsub -J "htseq-count" htseq-count \
-e /scratch/workspace/rnaseq/counts/err.txt \
-o /scratch/workspace/rnaseq/counts/log.out \
-f bam \
-r name \
-s no \
-a 10 \
-t exon \
-i gene_id \
-m intersection-nonempty \
/scratch/workspace/rnaseq/bam/Aligned.sortedByCoord.out.bam \
/scratch/workspace/rnaseq/refs/gencode.v22.annotation.gtf > /scratch/workspace/rnaseq/counts/SRR3088529_counts.txt

But it only generates a txt file which have only one line of information telling the job number and time that I had submitted. Here is the error file.

Traceback (most recent call last):
  File "/scratch/shilpeelab/.local/bin/htseq-count", line 4, in <module>
    __import__('pkg_resources').run_script('HTSeq==0.11.1', 'htseq-count')
  File "/usr/lib/python2.7/site-packages/", line 3007, in <module>
  File "/usr/lib/python2.7/site-packages/", line 728, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/", line 626, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pysam>=0.9.0

Based on this can you please help me as I am a newbie in this and could not figure out the problem. Thank you.

rna-seq htseq-count • 73 views
ADD COMMENTlink modified 3 days ago by Ido Tamir5.0k • written 3 days ago by archisman0

You need pysam version 0.9.0 or higher as indicated in the error message. Install it. Instead of show htseq-count you can also use featureCounts which comes as a precompiled binary and is notably faster.

ADD REPLYlink written 3 days ago by ATpoint28k
gravatar for Ido Tamir
3 days ago by
Ido Tamir5.0k
Ido Tamir5.0k wrote:

You also need pysam on the PYTHONPATH. Normally it should have been installed together with HTSeq-count automatically. Maybe more stuff is broken ... If you work on your own computer you could do this with e.g. pip install pysam . You could also start working with conda . If its on a shared computing thing you have to ask your adminstrator to fix this for you or you do it with e.g. conda

ADD COMMENTlink modified 3 days ago • written 3 days ago by Ido Tamir5.0k

Thanks for the reply. I just install pysam today. But it still does not work. I think I have to as my administrator to find the development library for the python.

ADD REPLYlink written 2 days ago by archisman0

I guess you use a different python than HTseq count. Best and easiest is you switch to conda and create your own environment independent of the administrators.

ADD REPLYlink written 2 days ago by Ido Tamir5.0k

Can you please guide me through how to do that?

ADD REPLYlink written 1 day ago by archisman0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1614 users visited in the last hour