Skip to content
Snippets Groups Projects
Commit 1c918718 authored by Magali Ruffier's avatar Magali Ruffier
Browse files

ENSCORESW-677: added method get_all_versions

returns a listref of all unique assembly versions available
parent f113e4c6
No related branches found
No related tags found
No related merge requests found
......@@ -618,8 +618,6 @@ sub fetch_sequence_level {
return $self->{'_dbID_cache'}->{$dbIDs[0]};
}
=head2 get_default_version
Arg [1] : none
......@@ -650,6 +648,39 @@ sub get_default_version {
=head2 get_all_versions
Arg [1] : none
Example : @versions = $csa->get_all_versions();
Description: Retrieves all the available versions of assemblies
Returntype : Listref of versions (strings)
Exceptions : throw if no version is defined
Caller : general
Status : Stable
=cut
sub get_all_versions {
my $self = shift;
my %hash_versions;
my @versions;
my $version;
foreach my $dbID (sort {$a <=> $b} keys %{$self->{'_rank_cache'}}) {
if ($self->{'_rank_cache'}->{$dbID}->version) {
$version = $self->{'_rank_cache'}->{$dbID}->version;
if (!$hash_versions{$version}) {
$hash_versions{$version} = 1;
push @versions, $version;
}
}
}
throw('No versions found') if(!scalar(@versions));
return \@versions;
}
=head2 get_mapping_path
......
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