Hi,
I am trying to convert gff3 file (please see below) to GTF. I used two tools suggested here gffread and agat here.
#gff-version 3
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 1 1345 . + . ID=gene_1;Name=Os01g0293800 gene;coverage=0.997;sequence_ID=0.982;extra_copy_number=0;copy_num_ID=gene_1_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 1623 3128 . - . ID=gene_6;Name=Os01g0293900 gene;coverage=0.999;sequence_ID=0.968;extra_copy_number=0;copy_num_ID=gene_6_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 20379 21605 . - . ID=gene_7;Name=Os01g0294500 gene;coverage=0.999;sequence_ID=0.995;extra_copy_number=0;copy_num_ID=gene_7_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 48673 50214 . - . ID=gene_5;Name=Os01g0294700 gene;coverage=1.0;sequence_ID=0.995;extra_copy_number=0;copy_num_ID=gene_5_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 102125 104501 . - . ID=gene_4;Name=Os01g0295600 gene;coverage=1.0;sequence_ID=0.992;extra_copy_number=0;copy_num_ID=gene_4_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 105502 108051 . - . ID=gene_3;Name=Os01g0295700 gene;coverage=0.996;sequence_ID=0.991;extra_copy_number=0;copy_num_ID=gene_3_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 114102 118497 . - . ID=gene_2;Name=Os01g0295900 gene;coverage=1.0;sequence_ID=0.997;extra_copy_number=0;copy_num_ID=gene_2_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 119424 122381 . - . ID=gene_21;Name=Os01g0296000 gene;coverage=1.0;sequence_ID=0.995;extra_copy_number=0;copy_num_ID=gene_21_0
Bg_94-1_CX35|chr01_10700000_16500000 Liftoff gene 122555 127107 . + . ID=gene_14;Name=Os01g0296100 gene;coverage=0.996;sequence_ID=0.992;extra_copy_number=0;copy_num_ID=gene_14_0
I was using following commands; AGAT-
agat_convert_sp_gff2gtf.pl --gff genes.gff -o genes.gtf
gffread-
gffread -E -F -O -T genes.gff -o genes.gtf
Both giving me an empty output (AGAT just retrive # comment). Can someone help me in this regard? Thank you!
Juke's suggestion below with AGAT is better, so I post this sed fix merely because I had it ready
Thank you for the command!
Keep in mind that this converts an ill formed GFF to an ill formed GTF. Juke34's first solution from below can save you some downstream trouble as AGAT handles, validates and fixes so much more. Set urgency aside, I'd rather look look into that than my hackish sed command