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.
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.