I've mapped my sample using bowtie2 with the following command:
bowtie2 -p 10 -x /home/carolgs/Cpapaya/bowtieIndex/Cpapaya_113_r.Dec2008.fa.index -1 filtered_PE1.fastq -2 filtered_PE2.fastq -S map.fastq.sam --very-sensitive-local
Now I need to count the reads. I'm trying to run HTSeq-count but it isn't working. I have a .sam file and the annotation file used while mapping is a gff3 without exons information. I'm using this command line:
samtools flagstat map.fastq.sam > flagstat samtools view -Sb map.fastq.sam > mapped.bam samtools sort -o SAM mapped.bam > sorted.sam python -m HTSeq.scripts.count -s yes -r pos -i ID -m intersection-nonempty -q sorted.sam /home/carolgs/Cpapaya/annotation/Cpapaya_113_ASGPBv0.4.gene.gff3 > counts_b.txt
And the error message I get in the log file is
" [Exception type: StopIteration, raised in count.py:126] [bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] invalid BAM binary header (this is not a BAM file). [bam_flagstat_core] Truncated file? Continue anyway. [samopen] SAM header is present: 5901 sequences. open: No such file or directory [bam_sort_core] fail to open file SAM Warning: No features of type 'exon' found. Error occured when reading beginning of SAM/BAM file.
I'm not sure about the feature I have to put at -i, I've tried with ID and Name and both of them gives me the same error message. Does anybody have an idea about where is my mistake?