Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • super0925
    Senior Member
    • Feb 2014
    • 206

    htseq-count error RNAME == '*' although flag bit &0x0004 cleared"

    Hi all

    I do rna-seq , after tophat mapping, I got 6 aligned.bam file . And I played them by Cuffdiff, it works. However, if I try Htseq-count on 6 aligned.bam file (I have sorted and transfer it to SAM), one of them have error and hence I cannot get the counts table.

    The error is

    Error occured when processing SAM input (line 4241616 of file aligned_sn.sam): ("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared", 'line 4241616 of file aligned_sn.sam') [Exception type: ValueError, raised in _HTSeq.pyx:1294]

    I check the line 4241616 of SAM file, it is

    B500959:23:HW5G2BGXX:1:21303:20052:4160 0 * 411525 50 22M1949N18M * 0 0 AAAGAATCAAGAGCTGCAGCGGGCAAGGCAGAGAGAGAAG AAAAAEEEEE6EEEEAEEEEEEEE/EE<EEEEAEEEEEEE AS:i:0 XM:i:2 XO:i:0 XG:i:0 MD:Z:0G18T20 NM:i:2 XS:A:+ NH:i:1
    I don't know why does it happen because it is first time I have this error, I am very confused. I know RNAME == '*' means an unmapped segment without coordinate.

    Now I want to know

    (1)Why does it happen?
    (2)What will I do?

    Thank you!
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Somehow you corrupted your BAM file, that alignment your showed shouldn't exist. Go back through your processing and try to determine when this alignment was introduced in this form and correct however that was done. My guess is that at some point you changed a BAM header and jumbled things up.

    Comment

    • super0925
      Senior Member
      • Feb 2014
      • 206

      #3
      Originally posted by dpryan View Post
      Somehow you corrupted your BAM file, that alignment your showed shouldn't exist. Go back through your processing and try to determine when this alignment was introduced in this form and correct however that was done. My guess is that at some point you changed a BAM header and jumbled things up.
      1.Do you mean I need to re-map the sample?
      2. Doe it mean that My cuffdiff could also potentially have problem?
      I ran 6 samples in a loop (Mapping, sorting BAM, Counting Reads)and hence I think the error shouldn't happen. But it happened, strange....
      Thank you!

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Originally posted by super0925 View Post
        1.Do you mean I need to re-map the sample?
        2. Doe it mean that My cuffdiff could also potentially have problem?
        I ran 6 samples in a loop (Mapping, sorting BAM, Counting Reads)and hence I think the error shouldn't happen. But it happened, strange....
        Thank you!
        1. Maybe, depends on where the problem occurred.
        2. I wouldn't trust the cuffdiff results if you fed it this file.

        Comment

        • super0925
          Senior Member
          • Feb 2014
          • 206

          #5
          Originally posted by dpryan View Post
          1. Maybe, depends on where the problem occurred.
          2. I wouldn't trust the cuffdiff results if you fed it this file.
          OK. I will try re-run it.
          I use
          Code:
          tophat2 -o outdir  --library-type fr-firststrand --keep-fasta-order --GTF genes.gtf  genome.fa Trimmed.fastq
          and get the aligned.bam, which I don't think there are any problems.
          However, Cuffdiff got the differential expression results on the bam file I talked above, which is beyond my expection...

          Comment

          • super0925
            Senior Member
            • Feb 2014
            • 206

            #6
            Originally posted by dpryan View Post
            1. Maybe, depends on where the problem occurred.
            2. I wouldn't trust the cuffdiff results if you fed it this file.
            Sorry I got SAME error!!
            I re-run the tophat, get the accepted_hits.bam , command is as follows:

            Code:
            [B]tophat2 -o outdir  --library-type fr-firststrand --keep-fasta-order --GTF genes.gtf  genome.fa Trimmed.fastq
            samtools sort -o aligned.bam -n -@ 8 accepted_hits.bam
            samtools view -o aligned.sam aligned.bam
            htseq-count -s yes aligned.sam genes.gtf>subset[/B]
            But I still get the error:

            Error occured when processing SAM input (line 4240949 of file Hor_sn.sam):
            ("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared", 'line 4240949 of file Hor_sn.sam')
            [Exception type: ValueError, raised in _HTSeq.pyx:1294]


            But this time is not 'line 4241616' but 'line 4240949 '. both SAM files have 1 row with '*' at column 3, on line 4241616 and 4240949 , respectively.
            Last edited by super0925; 04-29-2016, 07:18 AM.

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              Weird, I assume this same alignment is in the original "accepted_hits.bam" file. What happens if you don't specify "--keep-fasta-order"?

              Comment

              • super0925
                Senior Member
                • Feb 2014
                • 206

                #8
                Originally posted by dpryan View Post
                Weird, I assume this same alignment is in the original "accepted_hits.bam" file. What happens if you don't specify "--keep-fasta-order"?
                Hi D
                I tried it, but still get the error.
                "Error occured when processing SAM input (line 4240949 of file aligned.sam):
                ("Malformed SAM line: RNAME == '*' although flag bit &0x0004 cleared", 'line 4240949 of file aligned.sam')
                "
                What is your suggestion?
                Leave it and only stick to Cuffdiff? Or remove this line in SAM and to do HTseq and edgeR?
                Thank you!

                Comment

                Latest Articles

                Collapse

                • 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, 07-02-2026, 11:08 AM
                0 responses
                9 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-30-2026, 05:37 AM
                0 responses
                13 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-26-2026, 11:10 AM
                0 responses
                20 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-17-2026, 06:09 AM
                0 responses
                54 views
                0 reactions
                Last Post SEQadmin2  
                Working...