Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • loui_
    Junior Member
    • Oct 2019
    • 3

    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!
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Cross-posted (and has a possible answer): https://www.biostars.org/p/402237/

    Comment

    • loui_
      Junior Member
      • Oct 2019
      • 3

      #3
      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, 04:42 AM.

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        No need to delete. If someone finds this thread by search they will know where to get the answer.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Cancer Drug Resistance: The Lingering Barrier to Rising Survival
          by SEQadmin2



          Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

          There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
          Today, 05:17 AM
        • GATTACAT
          Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by GATTACAT
          Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
          07-01-2026, 11:43 AM
        • SEQadmin2
          Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by SEQadmin2


          I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

          Here are nine questions we think about, in roughly the order they matter, before...
          06-18-2026, 07:11 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 11:05 AM
        0 responses
        7 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-02-2026, 11:08 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-30-2026, 05:37 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-26-2026, 11:10 AM
        0 responses
        27 views
        0 reactions
        Last Post SEQadmin2  
        Working...