Skip to content

Commit

Permalink
Merge e9c1076 into c508cec
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopleton committed Mar 27, 2023
2 parents c508cec + e9c1076 commit d4073b5
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
63 changes: 63 additions & 0 deletions lib/Bio/EnsEMBL/DataCheck/Checks/CompareSpeciesAlias.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

=head1 LICENSE
Copyright [2018-2023] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an 'AS IS' BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut

package Bio::EnsEMBL::DataCheck::Checks::CompareSpeciesAlias;

use warnings;
use strict;

use Moose;
use Test::More;

extends 'Bio::EnsEMBL::DataCheck::DbCheck';

use constant {
NAME => 'CompareSpeciesAlias',
DESCRIPTION => 'Comparison of aliases between releases',
GROUPS => [ 'core_handover' ],
DB_TYPES => [ 'core' ],
TABLES => [ 'meta' ],
DATACHECK_TYPE => 'advisory'

};

sub skip_tests {
my ($self) = @_;
my $old_dba = $self->get_old_dba();
if (not defined $old_dba) {
return (1, 'New database');
}
}


sub tests {
my ($self) = @_;
my $old_dba = $self->get_old_dba();
my $mca = $self->dba->get_adaptor('MetaContainer');
my $old_mca = $old_dba->get_adaptor('MetaContainer');

my @new_alias = $mca->list_value_by_key('species.alias');
my @old_alias = $old_mca->list_value_by_key('species.alias');

my $description = 'Number of species.aliases did not decrease';
ok($#old_alias <= $#new_alias, $description );

}

1;
9 changes: 9 additions & 0 deletions lib/Bio/EnsEMBL/DataCheck/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,15 @@
"name" : "CompareSource",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::CompareSource"
},
"CompareSpeciesAlias" : {
"datacheck_type" : "advisory",
"description" : "Comparison of aliases between releases",
"groups" : [
"core_handover"
],
"name" : "CompareSpeciesAlias",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::CompareSpeciesAlias"
},
"CompareStableIdsMapping" : {
"datacheck_type" : "critical",
"description" : "Stable IDs have been mapped between old and new databases",
Expand Down

0 comments on commit d4073b5

Please sign in to comment.