<p>You can use <code>gffread</code> to convert <code>gff</code> to <code>gtf2</code>, below is from <a href="http://ccb.jhu.edu/software/stringtie/gff.shtml" rel="noreferrer">the manual</a>:</p>

<blockquote>
  <p>In order to see the GTF2 version of the same transcripts, the -T
  option should be added:</p>

<pre><code>gffread -E annotation.gff -T -o- | more
</code></pre>
  
  <p>The examples above also show that gffread can be used to convert a
  file between GTF2 and GFF3 file formats.</p>
</blockquote>

CC BY-SA 4.0
2020-02-01T06:22:36.140Z
Thk for your awnser
Diango
CC BY-SA 4.0
2019-12-29T09:46:01.213Z
2019-12-29T09:46:01.213Z
haci
<p>I would suggest to use <code>agat_convert_sp_gff2gtf.pl</code> from <a href="https://github.com/NBISweden/AGAT" rel="noreferrer">AGAT</a> because you loose information with <code>gffread</code>.<br>
e.g here a gff example:</p>

<pre><code>##gff-version 3
scaffold625 maker   gene    337818  343277  .   +   .   ID=CLUHARG00000005458;Name=TUBB3_2
scaffold625 maker   transcript  337818  343277  .   +   .   ID=CLUHART00000008717;Parent=CLUHARG00000005458
scaffold625 maker   CDS 337915  337971  .   +   0   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   CDS 340733  340841  .   +   0   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   CDS 341518  341628  .   +   2   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   CDS 341964  343033  .   +   2   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   exon    337818  337971  .   +   0   ID=CLUHART00000008717:exon1;Parent=CLUHART00000008717
scaffold625 maker   exon    340733  340841  .   +   0   ID=CLUHART00000008717:exon2;Parent=CLUHART00000008717
scaffold625 maker   exon    341518  341628  .   +   2   ID=CLUHART00000008717:exon3;Parent=CLUHART00000008717
scaffold625 maker   exon    341964  343277  .   +   2   ID=CLUHART00000008717:exon4;Parent=CLUHART00000008717
scaffold625 maker   five_prime_UTR  337818  337914  .   +   .   ID=CLUHART00000008717:five_prime_utr;Parent=CLUHART00000008717
scaffold625 maker   three_prime_UTR 343034  343277  .   +   .   ID=CLUHART00000008717:three_prime_utr;Parent=CLUHART00000008717
</code></pre>

<p>with gffread you get:</p>

<pre><code>scaffold625 maker   transcript  337818  343277  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    337818  337971  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    340733  340841  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    341518  341628  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    341964  343277  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 337915  337971  .   +   0   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 340733  340841  .   +   0   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 341518  341628  .   +   2   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 341964  343033  .   +   2   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
</code></pre>

<p>while with AGAT you get</p>

<pre><code>scaffold625 maker   gene    337818  343277  .   +   .   ID CLUHARG00000005458 ; Name TUBB3_2 ; gene_id CLUHARG00000005458
scaffold625 maker   mRNA    337818  343277  .   +   .   ID CLUHART00000008717 ; Parent CLUHARG00000005458 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    337818  337971  .   +   0   ID "CLUHART00000008717:exon1"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    340733  340841  .   +   0   ID "CLUHART00000008717:exon2"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    341518  341628  .   +   2   ID "CLUHART00000008717:exon3"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    341964  343277  .   +   2   ID "CLUHART00000008717:exon4"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 337915  337971  .   +   0   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 340733  340841  .   +   0   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 341518  341628  .   +   2   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 341964  343033  .   +   2   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   five_prime_UTR  337818  337914  .   +   .   ID "CLUHART00000008717:five_prime_utr"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   three_prime_UTR 343034  343277  .   +   .   ID "CLUHART00000008717:three_prime_utr"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
</code></pre>

<p>So you can see as example that <code>Name=TUBB3_2</code> from the gene feature disappeared with <code>gffread</code>.</p>

CC BY-SA 4.0
2020-03-13T13:05:39.923Z
2020-03-17T16:00:46.463Z
2020-03-17T16:00:46.463Z
juke34
<p>You can try bioinfokit (<a href="https://github.com/reneshbedre/bioinfokit" rel="nofollow noreferrer">https://github.com/reneshbedre/bioinfokit</a>) in python.</p>
<pre><code>from bioinfokit.analys import gff

gff.gff_to_gtf(file=&quot;yourfile.gff3&quot;) 
# The converted gtf file will be saved in the same working directory.
<span class="math-container">```</span>
</code></pre>

CC BY-SA 4.0
2021-12-21T18:02:55.693Z
2021-12-23T20:11:09.687Z
2021-12-23T20:11:09.687Z
Liyong
<p>Actually I started a mini-review about the tools to do such conversion.<br>
You can find it here: 
<a href="https://github.com/NBISweden/GAAS/blob/master/annotation/knowledge/gff_to_gtf.md" rel="nofollow noreferrer">https://github.com/NBISweden/GAAS/blob/master/annotation/knowledge/gff_to_gtf.md</a></p>

<p>As I mentioned earlier they do not behave all the same way...</p>

CC BY-SA 4.0
2020-03-17T16:03:41.023Z
2020-03-17T16:03:41.023Z
juke34
<p>My annotation file is in .gff format. I would like to convert it to .gtf format or to know if there is a way to directly download the annotation file in .gtf format?</p>

<p>I am working on sequences from the P Falicparum 3D7.</p>

CC BY-SA 4.0
2020-01-31T10:06:38.667Z
I think the question was already extensively answered here:
https://bioinformatics.stackexchange.com/questions/2068/how-to-convert-gff3-to-gtf2
aechchiki
CC BY-SA 4.0
2020-02-01T06:21:55.910Z
Thank you for your awnser
Diango
<rna-seq><gtf><gff>
How to convert gff to gtf?
# How to convert gff to gtf?

(Asked by: username_0 on 2019-12-29)

My annotation file is in .gff format. I would like to convert it to .gtf format or to know if there is a way to directly download the annotation file in .gtf format?

I am working on sequences from the P Falicparum 3D7.

**Tags:** rna-seq, gtf, gff
> **Comments:**
> **username_1**: I think the question was already extensively answered here: https://bioinformatics.stackexchange.com/questions/2068/how-to-convert-gff3-to-gtf2  
> **username_0**: Thank you for your awnser  

---

## 4 answers

### Answer by username_3 on 2020-03-13. Score: 6

I would suggest to use agat_convert_sp_gff2gtf.pl from AGAT because you loose information with gffread.
e.g here a gff example:
##gff-version 3
scaffold625 maker   gene    337818  343277  .   +   .   ID=CLUHARG00000005458;Name=TUBB3_2
scaffold625 maker   transcript  337818  343277  .   +   .   ID=CLUHART00000008717;Parent=CLUHARG00000005458
scaffold625 maker   CDS 337915  337971  .   +   0   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   CDS 340733  340841  .   +   0   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   CDS 341518  341628  .   +   2   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   CDS 341964  343033  .   +   2   ID=CLUHART00000008717:cds;Parent=CLUHART00000008717
scaffold625 maker   exon    337818  337971  .   +   0   ID=CLUHART00000008717:exon1;Parent=CLUHART00000008717
scaffold625 maker   exon    340733  340841  .   +   0   ID=CLUHART00000008717:exon2;Parent=CLUHART00000008717
scaffold625 maker   exon    341518  341628  .   +   2   ID=CLUHART00000008717:exon3;Parent=CLUHART00000008717
scaffold625 maker   exon    341964  343277  .   +   2   ID=CLUHART00000008717:exon4;Parent=CLUHART00000008717
scaffold625 maker   five_prime_UTR  337818  337914  .   +   .   ID=CLUHART00000008717:five_prime_utr;Parent=CLUHART00000008717
scaffold625 maker   three_prime_UTR 343034  343277  .   +   .   ID=CLUHART00000008717:three_prime_utr;Parent=CLUHART00000008717

with gffread you get:
scaffold625 maker   transcript  337818  343277  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    337818  337971  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    340733  340841  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    341518  341628  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   exon    341964  343277  .   +   .   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 337915  337971  .   +   0   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 340733  340841  .   +   0   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 341518  341628  .   +   2   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";
scaffold625 maker   CDS 341964  343033  .   +   2   transcript_id "CLUHART00000008717"; gene_id "CLUHARG00000005458";

while with AGAT you get
scaffold625 maker   gene    337818  343277  .   +   .   ID CLUHARG00000005458 ; Name TUBB3_2 ; gene_id CLUHARG00000005458
scaffold625 maker   mRNA    337818  343277  .   +   .   ID CLUHART00000008717 ; Parent CLUHARG00000005458 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    337818  337971  .   +   0   ID "CLUHART00000008717:exon1"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    340733  340841  .   +   0   ID "CLUHART00000008717:exon2"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    341518  341628  .   +   2   ID "CLUHART00000008717:exon3"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   exon    341964  343277  .   +   2   ID "CLUHART00000008717:exon4"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 337915  337971  .   +   0   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 340733  340841  .   +   0   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 341518  341628  .   +   2   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   CDS 341964  343033  .   +   2   ID "CLUHART00000008717:cds"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   five_prime_UTR  337818  337914  .   +   .   ID "CLUHART00000008717:five_prime_utr"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717
scaffold625 maker   three_prime_UTR 343034  343277  .   +   .   ID "CLUHART00000008717:three_prime_utr"  ; Parent CLUHART00000008717 ; gene_id CLUHARG00000005458 ; transcript_id CLUHART00000008717

So you can see as example that Name=TUBB3_2 from the gene feature disappeared with gffread.


---

### Answer by username_2 on 2019-12-29. Score: 5

You can use gffread to convert gff to gtf2, below is from the manual:

In order to see the GTF2 version of the same transcripts, the -T
  option should be added:
gffread -E annotation.gff -T -o- | more

The examples above also show that gffread can be used to convert a
  file between GTF2 and GFF3 file formats.

> **Comments:**
> **username_0**: Thk for your awnser  

---

### Answer by username_3 on 2020-03-17. Score: 1

Actually I started a mini-review about the tools to do such conversion.  
You can find it here:
<https://github.com/NBISweden/GAAS/blob/master/annotation/knowledge/gff_to_gtf.md>

As I mentioned earlier they do not behave all the same way...


---

### Answer by username_4 on 2021-12-21. Score: 0

You can try bioinfokit (https://github.com/reneshbedre/bioinfokit) in python.
from bioinfokit.analys import gff

gff.gff_to_gtf(file="yourfile.gff3") 
# The converted gtf file will be saved in the same working directory.
```


---

