I am using featureCounts for analysis of my RNA-seq data. I have used gtf file from ensemble for this.I keep on getting the following error report from featurecounts: Failed to open the annotation file Drosophila_melanogaster.gtf or its format is incorrect, or it contains no 'exon' features.
although I do see the feature when I read the file in text editor. I am using the following command:
./featureCounts -p -t exon -g gene_id -a Drosophila_melanogaster.chr.gtf -o counts.txt S2I2-n_sorted.bam what can I do to get feature count data? kindly help
Are you sure your genome and gtf file are the same version?
The error gives three options, and since you have exons in the file there are two options left. Or your file cannot be opened (did you check chmod?), or the format is not correct.
Did you get your genome and the GTF from two different sources( e.g. UCSC, Ensembl). If so, you almost certainly have chromosome names that do not match between the genome and the GTF. This has been noted by @b.nota here and by @Devon in the other thread.
You could edit the chromosome names in your GTF to match the ones in your BAM or obtain a corresponding GTF file from the source where you got your reference genome from. That should fix this problem with htseq-count and featureCounts.
Yes, I was using gtf files from different sources, however now that i am using the same source (ucsc genome browser), feature counts is still not working. It still gives the same error Failed to open the annotation file ucsc.gtf, or its format is incorrect, or it contains no 'exon' features.
Yeah, but your bam files also need to have the same format.
There is a difference in how they name chromosomes.
the bam files and the gtf file are from the same source (UCSC),but feature counts still gives me the same error . ht-seq is working fine with these files but its giving low read counts and that's why I want to get count data from featurecounts as well
How many reads did the original sample file have? What do the stats on the alignment (BAM) look like? It is possible that you have low alignment % to begin with which may be reflected in the low counts.