<p>How do I generate a custom gtf file format for  a organism of my interest similar to human gtf file, in the custom gtf file I want to add entrez id to the new custom gtf.</p>
<p>My organism is canis_familaris</p>
<p>I  have to use is this <a href="https://ftp.ncbi.nih.gov/gene/DATA/GENE_INFO/Mammalia/" rel="nofollow noreferrer">source</a>.</p>
<p>How do I start, is there any tools there to build custom gtf file from the GENE_INFO file?</p>
<p>From the gene_info file I extracted the ensembl and the entrezID column so here as an example I have taken only the top 10 head of the file.</p>
<pre><code>entrezID   dbXrefs
399518   VGNC:VGNC:43937|Ensembl:ENSCAFG00845006432
399530   VGNC:VGNC:40330|Ensembl:ENSCAFG00845002136
399544   VGNC:VGNC:48329|Ensembl:ENSCAFG00845029798
399545   VGNC:VGNC:41624|Ensembl:ENSCAFG00845011460
399653   VGNC:VGNC:44358|Ensembl:ENSCAFG00845001610
403152   -
403157   VGNC:VGNC:38980|Ensembl:ENSCAFG00845013158
403168   VGNC:VGNC:37699|Ensembl:ENSCAFG00845014982
403169   VGNC:VGNC:54270
</code></pre>
<p>My input gtf file</p>
<pre><code>#!genome-build ROS_Cfam_1.0
#!genome-version ROS_Cfam_1.0
#!genome-date 2020-09
#!genome-build-accession GCA_014441545.1
#!genebuild-last-updated 2020-10
X       ensembl gene    24550462        24552226        .       -       .       gene_id &quot;ENSCAFG00845015183&quot;; gene_version &quot;1&quot;; gene_source &quot;ensembl&quot;; gene_biotype &quot;protein_coding&quot;;
X       ensembl transcript      24550462        24552226        .       -       .       gene_id &quot;ENSCAFG00845015183&quot;; gene_version &quot;1&quot;; transcript_id &quot;ENSCAFT00845027108&quot;; transcript_version &quot;1&quot;; gene_source &quot;ensembl&quot;; gene_biotype &quot;protein_coding&quot;; transcript_source &quot;ensembl&quot;; transcript_biotype &quot;protein_coding&quot;; tag &quot;Ensembl_canonical&quot;;
X       ensembl exon    24552206        24552226        .       -       .       gene_id &quot;ENSCAFG00845015183&quot;; gene_version &quot;1&quot;; transcript_id &quot;ENSCAFT00845027108&quot;; transcript_version &quot;1&quot;; exon_number &quot;1&quot;; gene_source &quot;ensembl&quot;; gene_biotype &quot;protein_coding&quot;; transcript_source &quot;ensembl&quot;; transcript_biotype &quot;protein_coding&quot;; exon_id &quot;ENSCAFE00845128634&quot;; exon_version &quot;1&quot;; tag &quot;Ensembl_canonical&quot;;
X       ensembl CDS     24552206        24552226        .       -       0       gene_id &quot;ENSCAFG00845015183&quot;; gene_version &quot;1&quot;; transcript_id &quot;ENSCAFT00845027108&quot;; transcript_version &quot;1&quot;; exon_number &quot;1&quot;; gene_source &quot;ensembl&quot;; gene_biotype &quot;protein_coding&quot;; transcript_source &quot;ensembl&quot;; transcript_biotype &quot;protein_coding&quot;; protein_id &quot;ENSCAFP00845021332&quot;; protein_version &quot;1&quot;; tag &quot;Ensembl_canonical&quot;;
X       ensembl start_codon     24552224        24552226        .       -       0       gene_id &quot;ENSCAFG00845015183&quot;; gene_version &quot;1&quot;; transcript_id &quot;ENSCAFT00845027108&quot;; transcript_version &quot;1&quot;; exon_number &quot;1&quot;; gene_source &quot;ensembl&quot;; gene_biotype &quot;protein_coding&quot;; transcript_source &quot;ensembl&quot;; transcript_biotype &quot;protein_coding&quot;; tag &quot;Ensembl_canonical&quot;;
</code></pre>
<p>So the final goal is to add entrezID to the modified gtf file keeping the format same as it was in the input file.</p>
<p>Here in my small gtf input the gene_id is only for ENSCAFG00845015183 as due to space constraint i didn't put more lines.</p>
<p>So now how do I map my reference file entrezID to the gtf file gene_ID as this pattern <code>ENSCAFG</code> which is common in both the file.</p>
<p>Now in my mapping file I dont have entrezID for ENSCAFG00845015183 since due to first 10 row i have used to show.</p>
<p>So how do I map these two file where the modified gtf fill will have new attributes as entrezID</p>

CC BY-SA 4.0
2023-07-03T11:58:48.687Z
Please [edit] your question and i) add an example of your input file (you linked us to a directory, show us the _actual_ file) and ii) show what output you expect from that example. We need to know what ID you need (gene? transcript? protein? something else?) and the exact format you are trying to achieve.
terdon
CC BY-SA 4.0
2023-07-03T12:12:02.157Z
okay let me add more details to it
kcm
CC BY-SA 4.0
2023-07-03T12:31:13.540Z
@terdononstrike i have updated my question please do have a look and let me know how do i start
kcm
CC BY-SA 4.0
2023-07-04T14:28:56.603Z
@terdononstrike i found this tool https://agat.readthedocs.io/en/latest/tools/agat_sq_add_attributes_from_tsv.html which can do what i need but if i have to do it in shell script how to go about it?
kcm
<rna-seq><gtf>
building custom gtf file with entrez ID for any organism
# building custom gtf file with entrez ID for any organism

(Asked by: username_0 on 2023-07-02)

How do I generate a custom gtf file format for  a organism of my interest similar to human gtf file, in the custom gtf file I want to add entrez id to the new custom gtf.
My organism is canis_familaris
I  have to use is this source.
How do I start, is there any tools there to build custom gtf file from the GENE_INFO file?
From the gene_info file I extracted the ensembl and the entrezID column so here as an example I have taken only the top 10 head of the file.
entrezID   dbXrefs
399518   VGNC:VGNC:43937|Ensembl:ENSCAFG00845006432
399530   VGNC:VGNC:40330|Ensembl:ENSCAFG00845002136
399544   VGNC:VGNC:48329|Ensembl:ENSCAFG00845029798
399545   VGNC:VGNC:41624|Ensembl:ENSCAFG00845011460
399653   VGNC:VGNC:44358|Ensembl:ENSCAFG00845001610
403152   -
403157   VGNC:VGNC:38980|Ensembl:ENSCAFG00845013158
403168   VGNC:VGNC:37699|Ensembl:ENSCAFG00845014982
403169   VGNC:VGNC:54270

My input gtf file
#!genome-build ROS_Cfam_1.0
#!genome-version ROS_Cfam_1.0
#!genome-date 2020-09
#!genome-build-accession GCA_014441545.1
#!genebuild-last-updated 2020-10
X       ensembl gene    24550462        24552226        .       -       .       gene_id "ENSCAFG00845015183"; gene_version "1"; gene_source "ensembl"; gene_biotype "protein_coding";
X       ensembl transcript      24550462        24552226        .       -       .       gene_id "ENSCAFG00845015183"; gene_version "1"; transcript_id "ENSCAFT00845027108"; transcript_version "1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_source "ensembl"; transcript_biotype "protein_coding"; tag "Ensembl_canonical";
X       ensembl exon    24552206        24552226        .       -       .       gene_id "ENSCAFG00845015183"; gene_version "1"; transcript_id "ENSCAFT00845027108"; transcript_version "1"; exon_number "1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSCAFE00845128634"; exon_version "1"; tag "Ensembl_canonical";
X       ensembl CDS     24552206        24552226        .       -       0       gene_id "ENSCAFG00845015183"; gene_version "1"; transcript_id "ENSCAFT00845027108"; transcript_version "1"; exon_number "1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSCAFP00845021332"; protein_version "1"; tag "Ensembl_canonical";
X       ensembl start_codon     24552224        24552226        .       -       0       gene_id "ENSCAFG00845015183"; gene_version "1"; transcript_id "ENSCAFT00845027108"; transcript_version "1"; exon_number "1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_source "ensembl"; transcript_biotype "protein_coding"; tag "Ensembl_canonical";

So the final goal is to add entrezID to the modified gtf file keeping the format same as it was in the input file.
Here in my small gtf input the gene_id is only for ENSCAFG00845015183 as due to space constraint i didn't put more lines.
So now how do I map my reference file entrezID to the gtf file gene_ID as this pattern ENSCAFG which is common in both the file.
Now in my mapping file I dont have entrezID for ENSCAFG00845015183 since due to first 10 row i have used to show.
So how do I map these two file where the modified gtf fill will have new attributes as entrezID

**Tags:** rna-seq, gtf
> **Comments:**
> **username_1**: Please [edit] your question and i) add an example of your input file (you linked us to a directory, show us the _actual_ file) and ii) show what output you expect from that example. We need to know what ID you need (gene? transcript? protein? something else?) and the exact format you are trying to achieve.  
> **username_0**: okay let me add more details to it  
> **username_0**: @terdononstrike i have updated my question please do have a look and let me know how do i start  
> **username_0**: @terdononstrike i found this tool https://agat.readthedocs.io/en/latest/tools/agat_sq_add_attributes_from_tsv.html which can do what i need but if i have to do it in shell script how to go about it?  

---

## 0 answers

