Commit 219dfe13 authored by Magali Ruffier's avatar Magali Ruffier
Browse files

add more fields for GFF3 format

parent c1eba9c1
......@@ -1595,6 +1595,7 @@ sub summary_as_hash {
$summary_ref->{'constitutive'} = $self->is_constitutive;
$summary_ref->{'ensembl_phase'} = $self->phase;
$summary_ref->{'ensembl_end_phase'} = $self->end_phase;
$summary_ref->{'exon_id'} = $summary_ref->{'id'};
return $summary_ref;
}
......
......@@ -1470,7 +1470,9 @@ sub get_nearest_Gene {
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'id'} = $self->display_id;
my $id = $self->display_id;
if ($self->version()) { $id .= "." . $self->version(); }
$summary{'id'} = $id;
$summary{'version'} = $self->version() if $self->version();
$summary{'start'} = $self->seq_region_start;
$summary{'end'} = $self->seq_region_end;
......
......@@ -1482,6 +1482,7 @@ sub summary_as_hash {
$summary_ref->{'Name'} = $self->external_name if $self->external_name;
$summary_ref->{'logic_name'} = $self->analysis->logic_name();
$summary_ref->{'source'} = $self->source();
$summary_ref->{'gene_id'} = $summary_ref->{'id'};
return $summary_ref;
}
......
......@@ -3051,9 +3051,44 @@ sub summary_as_hash {
my $parent_gene = $self->get_Gene();
$summary_ref->{'Parent'} = $parent_gene->stable_id;
$summary_ref->{'source'} = $parent_gene->source();
$summary_ref->{'transcript_id'} = $summary_ref->{'id'};
$summary_ref->{'havana_transcript'} = $self->havana_transcript->display_id() if $self->havana_transcript();
$summary_ref->{'ccdsid'} = $self->ccds->display_id() if $self->ccds();
return $summary_ref;
}
=head2 havana_transcript
Example : $havana_transcript = $transcript->havana_transcript();
Description : Locates the corresponding havana transcript
Returns : Bio::EnsEMBL::DBEntry
=cut
sub havana_transcript {
my $self = shift;
my @otts = @{ $self->get_all_DBEntries('OTTT') };
my $ott;
$ott = $otts[0] if scalar(@otts) > 0;
return $ott;
}
=head2 ccds
Example : $ccds = $transcript->ccds();
Description : Locates the corresponding ccds xref
Returns : Bio::EnsEMBL::DBEntry
=cut
sub ccds {
my $self = shift;
my @ccds = @{ $self->get_all_DBEntries('CCDS') };
my $ccds;
$ccds = $ccds[0] if scalar(@ccds) > 0;
return $ccds;
}
=head2 get_Gene
Example : $gene = $transcript->get_Gene;
......
......@@ -1233,7 +1233,10 @@ sub get_all_DAS_Features{
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'id'} = $self->display_id;
my $id = $self->display_id;
if ($self->version) { $id .= "." . $self->version; }
$summary{'id'} = $id;
$summary{'protein_id'} = $id;
$summary{'genomic_start'} = $self->genomic_start;
$summary{'genomic_end'} = $self->genomic_end;
$summary{'length'} = $self->length;
......
......@@ -205,9 +205,8 @@ sub print_feature {
my @ordered_values = @summary{@ordered_keys};
while (my $key = shift @ordered_keys) {
my $value = shift @ordered_values;
delete $summary{$key};
if ($value && $value ne '') {
if ($key eq 'id') {
if ($key =~ /id/) {
if ($feature->isa('Bio::EnsEMBL::Transcript')) {
$value = 'transcript:' . $value;
} elsif ($feature->isa('Bio::EnsEMBL::Gene')) {
......@@ -217,6 +216,8 @@ sub print_feature {
} else {
$value = $so_term . ':' . $value;
}
} else {
delete $summary{$key};
}
if ($key eq 'Parent') {
if ($feature->isa('Bio::EnsEMBL::Transcript')) {
......
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