Unverified Commit 9316b05d authored by Tiago Grego's avatar Tiago Grego Committed by GitHub

Merge pull request #94 from Ensembl/bugfix/stable_id_length

Code to generate correct Ensembl stable ID
parents f366fa84 2caa40d2
......@@ -65,13 +65,11 @@ sub _fetch_new_by_type {
my $meta_container = $self->db->get_MetaContainer;
my $prefix =
($meta_container->get_primary_prefix || 'ENS')
. ($meta_container->get_species_prefix || '')
$meta_container->single_value_by_key('species.stable_id_prefix')
. $type_prefix;
# Stable IDs are always 18 characters long
my $rem = 18 - length($prefix);
return $prefix . sprintf "\%0${rem}d", $num;
# Stable IDs are species prefix + type prefix + 11 digit number. This has been changed from the existing 18 digit stable id generation which was Loutre DB based.
return $prefix . sprintf "\%011d", $num;
}
1;
......
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