3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
31 package Bio::EnsEMBL::IdMapping::StableIdGenerator::AedesAegypti;
33 # Package that implements incrementing and verification of Aedes aegypti
34 # stable IDs as used by the VectorBase project.
43 # This method will increment a stable ID. For Aedes aegypti, it will
44 # pick out the numerical part of the stable ID (no matter what type of
45 # stable ID it is) and increment it by one. It will then replace the
46 # numerical part by the incremented value and return the new stable
47 # ID. The parsing of the stable ID is very naive.
49 my ( $self, $stable_id ) = @_;
51 if ( !$self->is_valid($stable_id) ) {
52 throw(
"Unknown or missing stable ID: $stable_id.");
55 $stable_id =~ /^(\D*)(\d+)(\D*)/;
57 my $number_as_string =
"$2";
60 "%s" . sprintf(
"%%0%dd", length($number_as_string) ) .
"%s",
68 # A stable ID is a valid Aedes aegypti stable ID if it begins with the
69 # character string "AAEL".
71 my ( $self, $stable_id ) = @_;
73 if ( !( defined($stable_id) && $stable_id =~ /^AAEL/ ) ) {
return 0 }