This is a test version of Biostars. For the public version, visit https://www.biostars.org.
HTSeq: Error at the end of HTSeq analysis and an output of .count file with 0 byte

At the beginning of the process I get this warning:

Warning: Read HS1_07961:1:1308:18104:63516#3 claims to have an aligned mate which could not be found in an adjacent line.

Then, at the end of the SAM file, I get:

10800000 SAM alignment record pairs processed.
10900000 SAM alignment record pairs processed.
Error occured when processing SAM input (record #11138334 in file 7961_1_3.bam):
  reference_id -1 out of range 0<=tid<22
  [Exception type: ValueError, raised in calignmentfile.pyx:640]

and my output .count file was empty, with 0 byte.

The code I entered for this process is:

htseq-count -f bam -s no -a 10 7961_1_3.bam Mus_musculus.GRCm38.82.gtf > 7961_1_3.count

note that my BAM files contain pair ended strands.

Any help will be appreciated!

Thank you in advance.

htseq rna-seq

What's the output of samtools view 7961_1_3.bam | awk '{if(NR==11138334) print $0}'? It's likely that there's a malformed line.

is this thw last line of the bam file? maybe it's truncated, for some reason...

Is your bam sorted by name? htseq-count expects pairs to be sorted by name, thus they should be on adjacent lines.

How was the BAM file generated? Does it pass Picard tools validation?

0 answers

No answers yet.

Log in to answer this question.