diff --git a/modules/Bio/EnsEMBL/Gene.pm b/modules/Bio/EnsEMBL/Gene.pm index 1762eda423f9ab4bbee1a5938efba19e23ba4f1b..dd083f584d408309f8c25f55ce90d8564ae96040 100755 --- a/modules/Bio/EnsEMBL/Gene.pm +++ b/modules/Bio/EnsEMBL/Gene.pm @@ -875,4 +875,38 @@ sub temporary_id { } + + +=head2 species + + Arg [1] : optional Bio::Species $species + Example : none + Description: You can set the species for this gene if you want to use species + specific behaviour. Otherwise species is retrieved from attached + database. + Returntype : Bio::EnsEMBL::Species + Exceptions : none + Caller : external_name, external_db, general for setting + +=cut + + +sub species { + my ( $self, $species ) = @_; + + if( defined $species ) { + $self->{species} = $species; + } else { + if( ! exists $self->{species} ) { + if( defined $self->adaptor() ) { + $self->{species} = $self->adaptor()->db->get_MetaContainer() + ->get_Species(); + } + } + } + + return $self->{species}; +} + + 1;