gffread doesn't convert gff to gtf (blank file)
1
0
Entering edit mode
3.6 years ago
aka ▴ 10

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.4k views
ADD COMMENT
1
Entering edit mode
3.6 years ago
Juke34 8.9k

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

ADD COMMENT
1
Entering edit mode

Thank you it works well !

ADD REPLY

Login before adding your answer.

Traffic: 1283 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6