This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GFF3 to GTF

I'm tryning to convert a c elegans mirBase gff3 file to gtf file with gffread (by cufflinks) but my gtf output is blank.

The code:

gffread miRNA_WBcel215.gff3 -T -o miRNA_WBcel215.gtf

Who knows why?

Thank you

gff gtf

Hmm.. the command seems fine. Could you add some lines of WBcel215.gff3 in order to see how it looks like? For other hand, maybe you'd like to try the other solutions (apart from the gffread utility) proposed in this post.

1 answer

You could try the simple Perl approach to check if it works:

use Bio::Tools::GFF;

# $gff corresponds to your gff3 input file
my $gff_in = Bio::Tools::GFF->new(-file => $gff, -gff_version => 3);

# $gtf corresponds to your gtf output file
my $gtf_out = Bio::Tools::GFF->new(-file => $gtf, -gff_version => 2.5);

while( my $feature = $gff_in->next_feature) {
    $gtf_out->write_feature($feature);
}

Log in to answer this question.