HTseq does not generate any counts file
1
0
Entering edit mode
4.3 years ago
archisman • 0

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/pkg_resources.py", line 3007, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 728, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", 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 • 1.2k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode
4.3 years ago
Ido Tamir 5.2k

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 https://pypi.org/project/pysam/ . You could also start working with conda https://docs.conda.io/en/latest/ . 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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

Can you please guide me through how to do that?

ADD REPLY

Login before adding your answer.

Traffic: 2177 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6