SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in htseq count "Please provide two arguments" super0925 Bioinformatics 3 02-26-2014 12:48 AM
htseq-count: reads with letter "N" zzhao2 Bioinformatics 1 01-27-2014 12:01 PM
htseq-count: many reads are "no_feature". zzhao2 Bioinformatics 5 01-16-2014 08:23 AM
"not_aligment" from the output of HTseq-count flyingoyster Bioinformatics 5 09-03-2013 12:21 AM
HTseq count - all reads are "alignment_not_unique" dmsoanes Bioinformatics 2 07-12-2012 05:07 AM

Reply
 
Thread Tools
Old 04-29-2016, 03:01 AM   #1
super0925
Senior Member
 
Location: UK

Join Date: Feb 2014
Posts: 206
Default 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!
super0925 is offline   Reply With Quote
Old 04-29-2016, 03:21 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

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.
dpryan is offline   Reply With Quote
Old 04-29-2016, 03:39 AM   #3
super0925
Senior Member
 
Location: UK

Join Date: Feb 2014
Posts: 206
Default

Quote:
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!
super0925 is offline   Reply With Quote
Old 04-29-2016, 03:41 AM   #4
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Quote:
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.
dpryan is offline   Reply With Quote
Old 04-29-2016, 03:51 AM   #5
super0925
Senior Member
 
Location: UK

Join Date: Feb 2014
Posts: 206
Default

Quote:
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...
super0925 is offline   Reply With Quote
Old 04-29-2016, 07:13 AM   #6
super0925
Senior Member
 
Location: UK

Join Date: Feb 2014
Posts: 206
Default

Quote:
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:
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
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 at 07:18 AM.
super0925 is offline   Reply With Quote
Old 04-29-2016, 07:28 AM   #7
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Weird, I assume this same alignment is in the original "accepted_hits.bam" file. What happens if you don't specify "--keep-fasta-order"?
dpryan is offline   Reply With Quote
Old 04-30-2016, 10:16 AM   #8
super0925
Senior Member
 
Location: UK

Join Date: Feb 2014
Posts: 206
Default

Quote:
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!
super0925 is offline   Reply With Quote
Reply

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 10:02 PM.


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