Question: Convert gff3 to gtf with R or shell
0
gravatar for bioinfo8
13 months ago by
bioinfo8120
bioinfo8120 wrote:

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.

gtf shell ngs R gff3 • 1.3k views
ADD COMMENTlink written 13 months ago by bioinfo8120

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 REPLYlink written 13 months ago by michael.ante3.4k

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

ADD REPLYlink written 13 months ago by bioinfo8120
2
gravatar for Sej Modha
13 months ago by
Sej Modha4.4k
Glasgow, UK
Sej Modha4.4k wrote:

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 COMMENTlink modified 13 months ago • written 13 months ago by Sej Modha4.4k

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 REPLYlink modified 13 months ago • written 13 months ago by bioinfo8120
1

You could try -F option that preserves the attributes.

ADD REPLYlink modified 13 months ago • written 13 months ago by Sej Modha4.4k

Thank you, it worked. :)

gffread -E -F -O -T input.gff -o output.gtf
ADD REPLYlink modified 13 months ago • written 13 months ago by bioinfo8120
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1804 users visited in the last hour