Unconfigured Ad

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

    #1

    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

                • SEQadmin2
                  Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                  by SEQadmin2



                  Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                  Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                  ...
                  10-14-2026, 09:55 AM
                • SEQadmin2
                  New Genomics Technologies Take Aim at Long-Standing Limits
                  by SEQadmin2


                  Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                  We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                  ...
                  09-28-2026, 10:25 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, 10-22-2026, 11:13 AM
                0 responses
                29 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-22-2026, 10:48 AM
                0 responses
                22 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-15-2026, 10:52 AM
                0 responses
                39 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-14-2026, 05:39 AM
                0 responses
                45 views
                0 reactions
                Last Post SEQadmin2  
                Working...