SEQanswers

Go Back   SEQanswers > Applications Forums > RNA Sequencing



Similar Threads
Thread Thread Starter Forum Replies Last Post
htseq-count ERROR in GFF File? OxytocinHeadHunter Bioinformatics 0 05-27-2016 01:37 PM
Error with GTF file when using htseq-count MDonlin Bioinformatics 13 01-13-2015 09:29 AM
HTSeq.BAM_Reader error: .bam-file has no index ... JIrish Bioinformatics 4 10-09-2013 10:35 AM
Problems with htseq-count reading bam file created by STAR priya RNA Sequencing 3 06-02-2013 12:32 AM

Reply
 
Thread Tools
Old 10-09-2019, 08:33 AM   #1
loui_
Junior Member
 
Location: Berlin

Join Date: Oct 2019
Posts: 2
Default Non-ascii characters in bam file causes htseq-count error

Hello everybody,

I have aligned bam files (using STAR version 2.6.1a_08-27) and want to quantify them using htseq-count (version 0.9.1). When I run htseq-count, some bams run through perfectly fine, but for some I get following error:

>>>
....
13300000 SAM alignment record pairs processed.
13400000 SAM alignment record pairs processed.
Error occured when processing SAM input (record #26816395 in file /data/folder/file.bam):
'ascii' codec can't decode byte 0xe4 in position 4: ordinal not in range(128)
[Exception type: UnicodeDecodeError, raised in libcutils.pyx:134]
>>>

When I go back to the bam file, this specific line (26816395) contains a question mark in the quality part of the read (either ? or ^?). I used to deal with this by just removing this line since it were only one or a few reads per file; but now I have at least 30 lines or more with question marks, so I don't just want to remove all the reads.
The problem is that the character is not REALLY a question mark (I know this because when i try to grep for '?', nothing comes up). This means that it is just a substitution for an unknown character.


So my question is: how do I remove non-ascii characters in the bam file?
(alternatively: does somebody know where they come from in the first place? Can I redo the alignment using different parameters?)


I've been trying to find a solution for quite some time and I appreciate any help or work around :)

Thanks!
loui_ is offline   Reply With Quote
Old 10-10-2019, 05:27 AM   #2
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,994
Default

Cross-posted (and has a possible answer): https://www.biostars.org/p/402237/
GenoMax is offline   Reply With Quote
Old 10-10-2019, 05:33 AM   #3
loui_
Junior Member
 
Location: Berlin

Join Date: Oct 2019
Posts: 2
Default

Hi GenoMax!
Thanks for pointing this out, I posted the question here yesterday, but I didn't see it online nor did I get a mail that is was in the process of posting/ under review or anything similar. I figured it was a problem so that's why I posted it again on Biostars

Sorry! I will delete it here.
Thanks


.....
edit: how does one delete a thread?

Last edited by loui_; 10-10-2019 at 05:42 AM.
loui_ is offline   Reply With Quote
Old 10-10-2019, 06:14 AM   #4
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,994
Default

No need to delete. If someone finds this thread by search they will know where to get the answer.
GenoMax is offline   Reply With Quote
Reply

Tags
ascii, htseq-count, star, unix

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 09:23 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO