Skip to content

Commit

Permalink
Merge pull request #361 from Ensembl/hotfix/division_specific_repeatm…
Browse files Browse the repository at this point in the history
…asking

Adding some division specificity to repeatmasking metakey checks
  • Loading branch information
james-monkeyshines committed May 4, 2021
2 parents b753403 + 17170a9 commit 7ca21ec
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/Bio/EnsEMBL/DataCheck/Checks/MetaKeyConditional.pm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ sub repeat_analysis {
# in order to do a count, use SQL rather than API.
my $helper = $self->dba->dbc->sql_helper;
my $species_id = $self->dba->species_id;
my $mca = $self->dba->get_adaptor('MetaContainer');
my @rep_list = ();
if ($mca->get_division eq 'EnsemblPlants') {
@rep_list = qw("repeatmask_repeatmodeler");
}
else {
@rep_list = qw("repeatmask_repeatmodeler" "repeatdetector");
}
my $to_skip = join("', '", @rep_list);

my $sql = qq/
SELECT logic_name FROM
coord_system INNER JOIN
Expand All @@ -183,8 +193,7 @@ sub repeat_analysis {
analysis USING (analysis_id)
WHERE
species_id = $species_id
AND
logic_name <> "repeatmask_repeatmodeler"
AND logic_name NOT IN ('$to_skip')
GROUP BY
logic_name
ORDER BY logic_name
Expand All @@ -195,7 +204,6 @@ sub repeat_analysis {
skip 'No repeat features', 1 unless scalar(@logic_names);

my $desc = "'repeat.analysis' meta_keys exist for appropriate repeat analyses";
my $mca = $self->dba->get_adaptor('MetaContainer');
my @values = sort @{ $mca->list_value_by_key('repeat.analysis') };
is_deeply(\@values, \@logic_names, $desc);
}
Expand Down

0 comments on commit 7ca21ec

Please sign in to comment.