-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #512 from Ensembl/update/check_annotation_source
Update/check annotation source
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
=head1 LICENSE | ||
Copyright [2018-2022] 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::AnnotationSource; | ||
|
||
use warnings; | ||
use strict; | ||
|
||
use Moose; | ||
use Test::More; | ||
|
||
extends 'Bio::EnsEMBL::DataCheck::DbCheck'; | ||
|
||
use constant { | ||
NAME => 'AnnotationSource', | ||
DESCRIPTION => 'If present, the annotation_source meta key must be from an approved list', | ||
GROUPS => ['rapid_release'], | ||
DATACHECK_TYPE => 'critical', | ||
DB_TYPES => ['core'], | ||
TABLES => ['meta'] | ||
}; | ||
sub tests{ | ||
my ($self) = @_; | ||
|
||
my $mca = $self->dba->get_adaptor('MetaContainer'); | ||
|
||
SKIP: { | ||
my $method = $mca->single_value_by_key('genebuild.method'); | ||
if($method ne 'braker' && $method ne 'import' && $method ne 'external_annotation_import') { | ||
skip "Annotation source key not needed for Ensembl builds", 1; | ||
} | ||
|
||
my $desc = "'species.annotation_source' meta_key exists"; | ||
my $annotation_source = lc($mca->single_value_by_key('species.annotation_source')); | ||
ok($annotation_source, $desc); | ||
|
||
my $sources = 'braker|genbank|refseq|community|flybase|wormbase|veupathdb|noninsdc'; | ||
my $source_desc = "Source is allowed"; | ||
|
||
skip 'species.annotation_source meta key does not exist', 1 unless defined $annotation_source; | ||
|
||
like($annotation_source, qr/^$sources$/, $source_desc); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters