This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Count number of Genes in GFF3 file (Prokka output)

Hello .

please i have run prokka on eight strains and i have eight GFF files , i want to count number of genes in each GFF file , please tell me how to do that

Thank you

assembly sequence gene sequencing

If your GFF3 files are in proper format you could count occurrences of gene in field 3 in your files.

ctg123 . gene            1000  9000  .  +  .  ID=gene00001;Name=EDEN

Thank you for your answer but i think that gene is repeated more than one time for one gene , is like that

scaffold1_size61041 prokka  gene    29  829 .   +   .   ID=wAse_00001_gene;locus_tag=wAse_00001
scaffold1_size61041 Prodigal:002006 CDS 29  829 .   +   0   ID=wAse_00001;Parent=wAse_00001_gene;inference=ab init
io prediction:Prodigal:002006;locus_tag=wAse_00001;product=hypothetical protein
scaffold1_size61041 prokka  gene    1262    2740    .   +   .   ID=wAse_00002_gene;locus_tag=wAse_00002
scaffold1_size61041 Prodigal:002006 CDS 1262    2740    .   +   0   ID=wAse_00002;Parent=wAse_00002_gene;inference=ab init
io prediction:Prodigal:002006;locus_tag=wAse_00002;product=hypothetical protein

Those appear to be separate genes.

2 answers

You can use agat_sp_statistics.pl from AGAT

Prokka outputs a very detailed log, it will be the ${prefix}.log file in the output folder. E..g:

grep "Found" ~/projects/annotation/prokka/ngs56.log
 [15:23:01] Found 51 tRNAs
 [15:23:15] Found 7 rRNAs
 [15:25:16] Found 47 ncRNAs.
 [15:25:56] Found 3 CRISPRs
 [15:26:10] Found 2049 CDS
 [15:26:59] Found 892 unique /gene codes.
  

Log in to answer this question.