diff --git a/modules/Bio/EnsEMBL/DBSQL/MetaContainer.pm b/modules/Bio/EnsEMBL/DBSQL/MetaContainer.pm index ccbe61232c17dce83f0bd33e68d8e0333a30693b..51c41c4faeb8243e8219b0b271c3d469d4438714 100644 --- a/modules/Bio/EnsEMBL/DBSQL/MetaContainer.pm +++ b/modules/Bio/EnsEMBL/DBSQL/MetaContainer.pm @@ -262,8 +262,9 @@ sub get_genebuild { sub get_classification { my ($self) = @_; my $classification = $self->list_value_by_key('species.classification'); - splice(@{$classification}, 0, 2); # remove the sapiens, Homo from the backing array - return $classification; + my $copy = [@{$classification}]; + splice(@{$copy}, 0, 1); # remove the Homo sapiens + return $copy; } diff --git a/modules/t/metaContainer.t b/modules/t/metaContainer.t index d909702e8076bd1c4bb59e95f9e7df97736a61ad..f392648503d1966f1d6a29496335fb543fa7c9cd 100644 --- a/modules/t/metaContainer.t +++ b/modules/t/metaContainer.t @@ -63,6 +63,12 @@ $mc->store_key_value('species.division',$divname); $div = $mc->get_division(); ok($div eq $divname); +# +# classification +# +my $classification = [ qw/Hominidae Catarrhini Primates Eutheria Mammalia Vertebrata Chordata Metazoa Eukaryota/ ]; +is_deeply($mc->get_classification(), $classification, 'Checking classification as expected'); + # # Testing get_Species() # diff --git a/modules/t/test-genome-DBs/homo_sapiens/core/meta.txt b/modules/t/test-genome-DBs/homo_sapiens/core/meta.txt index 37fe516d07b5de756f1d73bc2a96a42e87dc546f..0b6bfa72296ef0f184bcbd14f568781f48de78b7 100644 --- a/modules/t/test-genome-DBs/homo_sapiens/core/meta.txt +++ b/modules/t/test-genome-DBs/homo_sapiens/core/meta.txt @@ -9,6 +9,7 @@ 27 1 species.classification Hominidae 34 1 species.classification Metazoa 35 1 species.classification Eukaryota +26 1 species.classification Homo sapiens 36 1 species.common_name Human 70 1 species.scientific_name Homo sapiens 3 1 species.taxonomy_id 9606