This is a test version of Biostars. For the public version, visit https://www.biostars.org.
gffread doesn't convert gff to gtf (blank file)

Hello ! I have a problem with my gff. At first my gff was like this:

Qrob_P0000010.2 qrobur  CDS 1   693 .   +   .   ID Qrob_P0000010.2; gene_id Qrob_P0000010.2; transcript_id Qrob_P0000010.2
Qrob_P0000020.2 qrobur  CDS 1   1188    .   +   .   ID Qrob_P0000020.2; gene_id Qrob_P0000020.2; transcript_id Qrob_P0000020.2
Qrob_P0000030.2 qrobur  CDS 1   660 .   +   .   ID Qrob_P0000030.2; gene_id Qrob_P0000030.2; transcript_id Qrob_P0000030.2

Then I tried to convert with gffread with this command :

gffread 25K.gff -T -o 25K_v2.gtf

The terminal displays the following error:

Error parsing attribute transcript_id ('"' required for GTF) at line:
Qrob_P0000010.2 qrobur  CDS 1   693 .   +   .   ID Qrob_P0000010.2; gene_id Qrob_P0000010.2; transcript_id Qrob_P0000010.2

So I modified my gff with this bash command :

cat 25K.gff | awk -F " " '{ print $1, $2, $3, $4, $5, $6, $7, $8, $9, "\""$10"\"", $11, "\""$12"\"", $13, "\""$14"\"" }' | sed 's/;"/";/g' > 25K_new.gff

When I check my new file, it looks correct:

Qrob_P0000010.2 qrobur CDS 1 693 . + . ID "Qrob_P0000010.2"; gene_id "Qrob_P0000010.2"; transcript_id "Qrob_P0000010.2"
Qrob_P0000020.2 qrobur CDS 1 1188 . + . ID "Qrob_P0000020.2"; gene_id "Qrob_P0000020.2"; transcript_id "Qrob_P0000020.2"
Qrob_P0000030.2 qrobur CDS 1 660 . + . ID "Qrob_P0000030.2"; gene_id "Qrob_P0000030.2"; transcript_id "Qrob_P0000030.2"

But when I try again the gffread command, the gtf file is created but it is empty...

I don't understand why, so if you could help me, that would be great! Aka

gffread bash

1 answer

It might be the space after the semi-colon. Give a try to agat_convert_sp_gff2gtf.pl from AGAT you might be more lucky

Thank you it works well !

Log in to answer this question.