SEQanswers (
-   Bioinformatics (
-   -   Error when using HTSeq count (

shocker8786 02-19-2014 04:20 AM

Error when using HTSeq count
I used Tophat to produce a bam file from paired end RNAseq data, as well as unpaired reads that were retained after trimming. I then sorted by read name and converted the bam to a sam file. When I run HTSeq with the following arguments:

python -m intersection-strict -s yes 13_accepted_hits.sam Sus_scrofa.gtf

I get an error message:

100000 GFF lines processed.
200000 GFF lines processed.
300000 GFF lines processed.
400000 GFF lines processed.
496967 GFF lines processed.
Error occured when processing SAM input (line 4684 of file 13_acc
'pair_alignments' needs a sequence of paired-end alignments
[Exception type: ValueError, raised in]

It looks to me that there are unpaired reads in the sam file that are causing the problem. Do I have to run separate Tophat alignments with the paired-end and unpaired data, then run the sam files through HTSeq and add the resulting counts together? Is there no way to use HTSeq with a both paired and unpaired reads in the same file? Thanks.

Jeremy 02-19-2014 05:08 PM

HTSeq requires that the file is name sorted, but the default sorting of some programs is position sorting. I had the same problem, resorting by name fixed it. I think it can handle paired end and non paired end in the same file (not certain), the problem comes when the name indicates a paired read but the next line is a diferent read.

samtools sort -n in.bam out.sort

shocker8786 02-19-2014 10:10 PM

As I said in the original post, I sorted by read name. However I know the unpaired reads have the /1 and /2 read name endings, so maybe that could be the issue?

All times are GMT -8. The time now is 12:21 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.