Question: Error during htseq-count
gravatar for baffiak1902
2.8 years ago by
baffiak190210 wrote:


I've updated htseq-count into version 0.9.1 (because I've wanted to use function --nonunique all), but it failed with error

Error occured when reading beginning of SAM/BAM file.
'csamtools.AlignedRead' object has no attribute 'reference_start'
[Exception type: AttributeError, raised in _HTSeq.pyx:1357]

and I don't know, how to fix it.

For generating of BAM file, I've used STAR version 2.5.3a_modified with command:

~/STAR_2.5.3a_modified/bin/Linux_x86_64/STAR --genomeDir /mnt/d/Xenopus_9_2 --readFilesIn sortmerna/sort_15_3A_1_sequence.fastq sortmerna/sort_15_3A_2_sequence.fastq --runThreadN 12 --outFileNamePrefix STAR/15_3A/15_3A --outSAMtype BAM SortedByCoordinate

and I'm running htseq-count with command:

htseq-count -f bam -t exon -i ID --additional-attr=gene -r pos -m intersection-nonempty --nonunique all -s no STAR/15_3A/15_3AAligned.sortedByCoord.out.bam /mnt/d/Xenopus_9_2/XENLA_9.2_Xenbase.gff3 > count/15_3A.count

pysam version:

Thanks for help.

pysam star htseq-count • 1.4k views
ADD COMMENTlink modified 4 months ago by Biostar ♦♦ 20 • written 2.8 years ago by baffiak190210

OK, I found a problem. BAM file generated by STAR doesn't contain correct names of for newer version of samtools. After converting it into SAM and again into BAM, it works correctly.

ADD REPLYlink written 2.8 years ago by baffiak190210


So you updated your STAR version ? and realigned files?


ADD REPLYlink written 2.8 years ago by Ron990

I had a last version of STAR, but I worked with old version of htseq-count for long time. But newer version of htseq-count works with descriptions in newer version of samtools and STAR use old names for BAM fromat.

So, I've converted BAM file from STAR into SAM file, and SAM file again into BAM. I thnik (I hadn't time to test it), I can generate results from STAR directly into SAM, convert and sort it into BAM, and I can use htseq-count after that.

But I want to write bug report to Alex Dobin.

ADD REPLYlink written 2.8 years ago by baffiak190210
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: 796 users visited in the last hour