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::AnophelesGambiae;
33 # Package that implements incrementing and verification of Aedes aegypti
34 # stable IDs as used by the VectorBase project.
35 # Based on Aedes_Aegypti.pm
36 # Differs from Aedes in that Exon stable ids like Ennnnnn not AAEL.ennnnnn
37 # and gene/transcript/translation start AGAP not AAEL
38 # also need to exclude old Ensembl-style ids
47 # This method will increment a stable ID. For Anopheles, it will
48 # pick out the numerical part of the stable ID (no matter what type of
49 # stable ID it is) and increment it by one. It will then replace the
50 # numerical part by the incremented value and return the new stable
51 # ID. The parsing of the stable ID is very naive.
53 my ( $self, $stable_id ) = @_;
55 if ( !$self->is_valid($stable_id) ) {
56 throw(
"Unknown or missing stable ID: $stable_id.");
59 $stable_id =~ /^(\D*)(\d+)(\D*)/;
61 my $number_as_string =
"$2";
64 "%s" . sprintf(
"%%0%dd", length($number_as_string) ) .
"%s",
72 # A stable ID is a valid Anopheles stable ID if it begins with the
73 # character string "AGAP" or (for exons) just "E"
74 # explicitly make the exon one E+digits to exclude old-style ENSANG ids
75 # otherwise ENSANGnnn found as higher then AGAPnnn
76 # when initial_stable_id method checks archive tables
78 my ( $self, $stable_id ) = @_;
80 if ( !( defined($stable_id) && ( $stable_id =~ /^AGAP/ || $stable_id =~ /^E\d+$/ ) ) ) {