Thank you for pointing out the mistake in assigning the gene tag in "-i". The output I got is by using "-i ID", if you see my command above.
As per the manual: If the name of the attribute containing the gene ID for exon lines is not gene_id, use the --idattr. Often, its is, for example, Parent, GeneID or ID. Make sure it is the gene ID and not the exon ID.
Sorry I didn't paste my full gff file in the question
NC_037545.1 Gnomon gene 3503760 3523716 . - . ID=gene-NKIRAS1;Dbxref=GeneID:102394338;Name=NKIRAS1;gbkey=Gene;gene=NKIRAS1;gene_biotype=protein_coding
NC_037545.1 Gnomon mRNA 3503760 3523716 . - . ID=rna-XM_006074115.2;Parent=gene-NKIRAS1;Dbxref=GeneID:102394338,Genbank:XM_006074115.2;Name=XM_006074115.2;gbkey=mRNA;gene=NKIRAS1;model_evidence=Supporting evidence includes similarity to: 5 Proteins%2C and 100%25 coverage of the annotated genomic feature by RNAseq alignments%2C including 152 samples with support for all annotated introns;product=NFKB inhibitor interacting Ras like 1%2C transcript variant X1;transcript_id=XM_006074115.2
NC_037545.1 Gnomon exon 3523593 3523716 . - . ID=exon-XM_006074115.2-1;Parent=rna-XM_006074115.2;Dbxref=GeneID:102394338,Genbank:XM_006074115.2;gbkey=mRNA;gene=NKIRAS1;product=NFKB inhibitor interacting Ras like 1%2C transcript variant X1;transcript_id=XM_006074115.2
NC_037545.1 Gnomon exon 3515344 3515454 . - . ID=exon-XM_006074115.2-2;Parent=rna-XM_006074115.2;Dbxref=GeneID:102394338,Genbank:XM_006074115.2;gbkey=mRNA;gene=NKIRAS1;product=NFKB inhibitor interacting Ras like 1%2C transcript variant X1;transcript_id=XM_006074115.2
NC_037545.1 Gnomon exon 3509449 3509690 . - . ID=exon-XM_006074115.2-3;Parent=rna-XM_006074115.2;Dbxref=GeneID:102394338,Genbank:XM_006074115.2;gbkey=mRNA;gene=NKIRAS1;product=NFKB inhibitor interacting Ras like 1%2C transcript variant X1;transcript_id=XM_006074115.2
ID: is different for different exon
Parent: is same for exons within mRNA, but different for exons between mRNAs of same gene
gene: is same for all exons of a gene.
Is it correct to use "-i gene" ?? Link to my full gff file is this
Please suggest the correct attribute for "-i". Thank you
Using
grep -v 'tRNA'removes mRNA of genes like tRNA methyltransferase. Usingawk '$3 !~ /tRNA/'retains exons of tRNA.Please check if this approach is correct.
write lines without 'gene'
grep -v gene my.gff > no_gene_gffCheck features of no_gene_gff
awk '{print $3}' no_gene_gff | sort | uniq -c514
509 1
1 annotwriter
1 Bubalus
26169 cDNA_match
2 D_loop
24 exon
1 origin_of_replication
509 region
2 rRNA
22 tRNA
Since the lines without genes doesnot have mRNA as evident from above is it ok to use,
grep 'gene' my_gff file > gene_gff fileand use this gene_gff file for htseqcount?