Commit 3ecee389 authored by Amonida Zadissa's avatar Amonida Zadissa
Browse files

Update GTFSerializer.pm

Skipping trans-splicing transcripts and the gene if it's a single transcript gene with optimisation call.
parent 3e72afee
......@@ -113,15 +113,30 @@ sub print_Gene {
$biotype_display = $vegadb ? $gene->status . '_' . $gene->biotype : $gene->biotype;
}
print $fh sprintf(qq{%s\t%s\tgene\t%d\t%d\t.\t%s\t.\t},
$idstr, $gene->source,
($gene->start()+$sliceoffset), ($gene->end()+$sliceoffset),
($strand_conversion{$gene->strand}));
$self->_print_attribs($gene, $biotype_display, $gene, $biotype_display, 0, 'gene');
print $fh "\n";
# Skip all trans-splicing transcripts, they can't be dumped in GTF
# format.
my @transcripts = @{$gene->get_all_Transcripts()};
my $single_trans_gene = scalar(@transcripts);
my %trans_splicing_ids;
foreach my $t (@transcripts) {
if (map { $_->value } @{ $t->get_all_Attributes('trans_spliced') }) {
$trans_splicing_ids{$t->stable_id()} = 1;
}
}
if ((values (%trans_splicing_ids)) && $single_trans_gene == 1) {
return;
} else {
print $fh sprintf(qq{%s\t%s\tgene\t%d\t%d\t.\t%s\t.\t},
$idstr, $gene->source,
($gene->start()+$sliceoffset), ($gene->end()+$sliceoffset),
($strand_conversion{$gene->strand}));
$self->_print_attribs($gene, $biotype_display, $gene, $biotype_display, 0, 'gene');
print $fh "\n";
}
# Now print all transcripts
foreach my $t (@{$gene->get_all_Transcripts()}) {
foreach my $t (@transcripts) {
next if (exists ($trans_splicing_ids{$t->stable_id()}));
$self->print_feature($t, $gene);
}
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment