Convert gff3 to gtf with R or shell
1
0
Entering edit mode
6.3 years ago
bioinfo8 ▴ 230

Hi,

I have gff3 file in the following format:

#gff-version 3
##sequence-region   Chromosome 1 <some_number>
#!genome-build European Nucleotide Archive <some_number>
#!genome-version <some_number>
#!genome-date 2014-10
#!genome-build-accession <some_number>
#!genebuild-last-updated 2014-10
Chromosome  European Nucleotide Archive chromosome  1   <some_number>   .   .   ID=chromosome:Chromosome;Alias=<some_number>;Is_circular=true
###
Chromosome  ena gene    16  1000    .   +   .   ID=gene:<gene_name>;Name=<name>;biotype=protein_coding;description=initiator protein<name>;gene_id=<id>;logic_name=ena
Chromosome  ena mRNA    16  1000    .   +   .   ID=transcript:<name>;Parent=gene:AJAP_00005;Name=<name>;biotype=protein_coding;transcript_id=<id>
Chromosome  ena exon    16  1000    .   +   .   Parent=transcript:<name>;Name=<name>;constitutive=1;ensembl_end_phase=0;ensembl_phase=0;exon_id=<id>;rank=1
Chromosome  ena CDS     16  1000    .   +   0   ID=CDS:<name>;Parent=transcript:<name>;protein_id=<id>
###

I have used two ways to convert gff3 to gtf: 1) gffread and 2) gff3ToGenePred and genePredToGtf . Both missed the biotype attribute in the gtf file. I want to include biotype in the gtf file.

Any guidance please.

Thanks.

R ngs shell gff3 gtf • 6.2k views
ADD COMMENT
0
Entering edit mode

Did you try the option -attrsOut=file with gff3ToGenePred? There you get

output attributes of mRNA record to file. These are per-genePred row, not per-GFF3 record. Thery are derived from GFF3 attributes, not the attributes themselves.

ADD REPLY
0
Entering edit mode

Thanks, but I got with -F option in gffread.

ADD REPLY
2
Entering edit mode
6.3 years ago
Sej Modha 5.3k

Is that an actual gff that you are using or you have modified it before posting here? Did you try -F full GFF attribute preservation (all attributes are shown) in gffread command?

ADD COMMENT
0
Entering edit mode

I have modified it before posting, but format is same. :)

No, I did not try that. I used:

gffread -E -O -T input.gff -o output.gtf
ADD REPLY
1
Entering edit mode

You could try -F option that preserves the attributes.

ADD REPLY
2
Entering edit mode

Thank you, it worked. :)

gffread -E -F -O -T input.gff -o output.gtf
ADD REPLY

Login before adding your answer.

Traffic: 2414 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