This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using multiple gff files for featureCounts tool

Hi,

I have bam file, I want to use featureCounts to extract raw counts. for my organism, there are;

chromosome_1.gff
chromosome_2.gff
chromosome_2F.gff
chromosome_3.gff
chromosome_3F.gff
chromosome_4.gff
chromosome_5.gff
chromosome_6.gff
chromosome_BF.gff
chromosome_M.gff
chromosome_R.gff

I did

featureCounts -a chromosome_1.gff chromosome_2.gff chromosome_2F.gff chromosome_3.gff chromosome_3F.gff chromosome_4.gff chromosome_5.gff chromosome_6.gff chromosome_BF.gff chromosome_M.gff chromosome_R.gff -o counts SRR159344.txt SRR159344.bam

ERROR: invalid parameter: 'chromosome_2.gff'

Should one merge gff files or error is from something else????

software error rna-seq alignment

Why not pasting all gff into a single file?

cat *gff > my_annotation.gff

Thanks a lot, I think your code worked

Sorry I obtained so; no raw read

# Program:featureCounts v1.6.2; Command:"featureCounts" "-t" "exon" "-g" "gene_id" "-a" "chromosome_1.gff" "-o" "counts.txt" "SRR1593424.bam" 
Geneid  Chr Start   End Strand  Length  SRR1593424.bam
    DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428;DDB0232428

You think why? I also tried my_annotation.gff suggested by you but outcome was the same

Running ==================================\\
||                                                                            ||
|| Load annotation file annotation.gff ...                                    ||

Warning: failed to find the gene identifier attribute in the 9th column of the provided GTF file.
The specified gene identifier attribute is 'gene_id' 
The attributes included in your GTF annotation are 'Parent=DDB0216437' 

||    Features : 61079                                                        ||
||    Meta-features : 1                                                       ||
||    Chromosomes/contigs : 11                                                ||
||                                                                            ||
|| Process SAM file SRR1593424.sam...                                         ||
||    Single-end reads are included.                                          ||
||    Assign reads to features...                                             ||
||    Total reads : 6709408                                                   ||
||    Successfully assigned reads : 6263556 (93.4%)                           ||
||    Running time : 0.11 minutes                                             ||
||                                                                            ||
||                         Read assignment finished.

1 answer

The error message is clear:

Warning: failed to find the gene identifier attribute in the 9th column of the provided GTF file.

The specified gene identifier attribute is 'gene_id'

The attributes included in your GTF annotation are 'Parent=DDB0216437'

Try using -g Parent.

Sorry, newly whatever I am trying on featureCounts I am being stoped by

dhcp179185:bin $ featureCounts -t exon -g gene_id -a annotation.gff -o counts.txt out2444_sorted.bam
-bash: featureCounts: command not found
dhcp179185:bin $ pwd
/volumes/subread/subread-1.6.2-source/bin
dhcp179185:bin$

I really can't figure out why :(

How come you managed to run it before? You have to add featureCounts to the PATH environment variable, or call it with its full path:

/volumes/subread/subread-1.6.2-source/bin/featureCounts -t exon -g gene_id -a annotation.gff -o counts.txt out2444_sorted.bam

Or, if you are in the same folder as the executable, use the relative path:

./featureCounts -t exon -g gene_id -a annotation.gff -o counts.txt out2444_sorted.bam

Thanks a lot, adding ./ worked. Thanks again

Sorry,

The rate of assignation is too low

                                                                         ||
|| Load annotation file annotation.gff ...                                    ||
||    Features : 61079                                                        ||
||    Meta-features : 29240                                                   ||
||    Chromosomes/contigs : 11                                                ||
||                                                                            ||
|| Process BAM file out2444_sorted.bam...                                     ||
||    Single-end reads are included.                                          ||
||    Assign reads to features...                                             ||
||    Total reads : 5429090                                                   ||
||    Successfully assigned reads : 298345 (5.5%)                             ||
||    Running time : 0.10 minutes

I edited gene_id with to Parent, based on the previous warning

What would a solution to resolve the rate of assignation?

Log in to answer this question.