I would like to convert a file in gff3
format to a gtf2.2
format.
The reason why I would like to do this is: I have a set of transcripts assembled by a bunch of different software (and using RNA-seq data from different sequencing technologies) and I would like to compare each of those sets with the reference transcriptome annotation for that species (D. melanogaster). I already asked for the community advice about how to proceed on that, but to run the suggested software (TACO and cuffmerge) I need to have a GTF file containing the experimental transcripts to compare to the reference transcripts (GTF).
Up to now, I unsuccessfully tried:
gffread
utility in the Cufflinks package (gffread input.gff3 -T -o output.gtf
): this results in an emptyoutput.gtf
file and an emptylog
file (usedCufflinks
v.2.2.1) - I contacted the authors via their Google group but haven't heard of them yetgff3_to_gtf
utility in the GenomeTools (gt
) package (gt gff3_to_gtf input.gff3 -o output.gtf
): the output is not created and the log file is not informative - I contacted the authors via their mailing list but haven't heard of them yetGFF3_to_GTF
utility in the FML package (./gff3_to_gtf_converter.pl input.gff3 output.gtf
): the output just contains a header (##gff-version 2.5
) and thelog
is empty
The gff3
file was created as output of GMAP, and contains the transcripts as found by alignment to the reference (specifying option -f gff3_match_cdna
).
[Edit: what I found out a poteriori, is that this format is not a standard gff3, thus the conversion is not trivial...]
Here is the beginning of the gff3 file I tried to convert:
$ head r9_gmap_match-cdna.gff
##gff-version 3
# Generated by GMAP version 2017-04-24 using call: /home/aechchik/software/gmap-2017-04-24/bin/gmap.sse42 -d gmapidx -D /scratch/beegfs/monthly/aechchik/isoforms/ref/chromosomes/ -f gff3_match_cdna -n 0 -t 20 r9_2d.fasta
2L gmapidx cDNA_match 18442664 18443024 79 - . ID=ae6a7818-85b5-4739-8031-e58f4462ad41_Basecall_2D_2d.path1;Name=ae6a7818-85b5-4739-8031-e58f4462ad41_Basecall_2D_2d;Target=ae6a7818-85b5-4739-8031-e58f4462ad41_Basecall_2D_2d 141 489;Gap=M13 I10 M8 D3 M8 D3 M32 D1 M4 D2 M5 D3 M34 I3 M6 D1 M7 D1 M5 D1 M30 D2 M16 I1 M8 D3 M10 D1 M5 D1 M6 I1 M8 I1 M8 D1 M33 D3 M33 I1 M28 D3 M25
###
3R gmapidx cDNA_match 15853880 15855465 96 + . ID=dd2444cf-34d6-4cd3-87ab-0ae1f3cb1f96_Basecall_2D_2d.path1;Name=dd2444cf-34d6-4cd3-87ab-0ae1f3cb1f96_Basecall_2D_2d;Target=dd2444cf-34d6-4cd3-87ab-0ae1f3cb1f96_Basecall_2D_2d 80 1645;Gap=M46 D2 M12 D2 M157 D3 M4 D1 M50 I2 M3 I1 M12 I1 M68 I1 M66 I1 M53 D2 M47 D1 M16 D1 M35 D1 M155 D1 M28 D1 M166 D2 M47 D1 M8 D4 M69 D1 M28 D1 M5 D1 M12 D1 M202 I1 M115 D1 M61 I2 M7 D1 M7 I1 M36 D2 M41
3R gmapidx cDNA_match 15855529 15855742 97 + . ID=dd2444cf-34d6-4cd3-87ab-0ae1f3cb1f96_Basecall_2D_2d.path1;Name=dd2444cf-34d6-4cd3-87ab-0ae1f3cb1f96_Basecall_2D_2d;Target=dd2444cf-34d6-4cd3-87ab-0ae1f3cb1f96_Basecall_2D_2d 1646 1856;Gap=M21 D1 M68 D1 M85 D1 M37
###
X gmapidx cDNA_match 14837810 14838142 93 - . ID=960b50cd-945e-4c12-b9bc-367f965575bb_Basecall_2D_2d.path1;Name=960b50cd-945e-4c12-b9bc-367f965575bb_Basecall_2D_2d;Target=960b50cd-945e-4c12-b9bc-367f965575bb_Basecall_2D_2d 74 406;Gap=M13 D1 M182 I1 M14 I2 M56 I1 M30 D2 M21 D1 M13
X gmapidx cDNA_match 14837470 14837753 92 - . ID=960b50cd-945e-4c12-b9bc-367f965575bb_Basecall_2D_2d.path1;Name=960b50cd-945e-4c12-b9bc-367f965575bb_Basecall_2D_2d;Target=960b50cd-945e-4c12-b9bc-367f965575bb_Basecall_2D_2d 407 688;Gap=I2 M5 I1 M64 I1 M44 D1 M9 D5 M31 D3 M23 I1 M19 I1 M25 I1 M26 D1 M19 I1 M9
###
gene_id
andtranscript_id
fields and, if so, where would that information come from? It might be helpful if you came into our chat room. If you do, ping me (@terdon
) to let me know. $\endgroup$rtracklayer
in R and also failed (rtracklayer doesn't want to output proper GTF format) :( I wonder if a bit of python/perl would suffice. $\endgroup$