Htseq Count Error
0
0
Entering edit mode
5.9 years ago
Payal ▴ 160

I was running Htseq count.

htseq-count --format bam --additional-attr=gene_name --idattr=gene_id --order pos -t exon TS11_S28_merged_PE.bam example.gtf > count.txt

I encountered this following error:

Error occured when processing SAM input (record #443898 in file TS11_S28_merged_PE.bam):
  'NoneType' object has no attribute 'encode'
  [Exception type: AttributeError, raised in _HTSeq.pyx:1358]

What does this mean? How to resolve this?

Addition: I converted the bam file to sam file and did the following:

$ awk '{if(NR==443898) print $0;}' TS11_S28_merged_PE.sam
A00264:8:H3HVKDMXX:1:2253:31376:208 393 2   32916253    0   79M70N65M7S =   32916253    GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGTGGGGTGGGGGGGGGGGGGGGGTTGGGGGTGGGGGGTGGGGGGGTGGTGGT FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF-FFFFF--FF-FFFFFFFFF-FFF-F-F--FFFF-F-FF--FF88FF-FF-----F--F-F8----F-8--8------------- AS:i:-28    ZS:i:-28    XN:i:XM:i:7 XO:i:0  XG:i:0  NM:i:7  MD:Z:100G4G12A3G0G5G6G7 YT:Z:UP NH:i:5

Thanks, Payal

RNA-Seq • 3.3k views
ADD COMMENT
0
Entering edit mode

Use featureCounts instead and you can get your results faster.

ADD REPLY
0
Entering edit mode

Have you found the solution? I got the same error message and don't know what to do. Thanks.

ADD REPLY
0
Entering edit mode

Hi,

I actually was able to get around this by filtering the BAM files for mapped and paired-end reads using samtools.

Eg: samtools view -b -F 4 bam_file > mapped_bam_file

samtools view -bf 1 bam_file > pairedend_bam_file

After filtering the BAM files, HTSeq eventually worked for my dataset!

Payal

ADD REPLY
0
Entering edit mode

Hi,

I had the same problem. But, at the end my error was not really due to HTseq. By mistake, to map my reads, I was using STAR 2.6 with an old reference that was done with STAR 2.4. The software did not complain, but HTSeq was no able to work with the resulting .bam files. Running STAR with a correct reference make it right.

ADD REPLY

Login before adding your answer.

Traffic: 2419 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