Skip to content

Commit

Permalink
Merge 7986aff into 1bdf204
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoooo committed Nov 15, 2018
2 parents 1bdf204 + 7986aff commit 69b3559
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
55 changes: 55 additions & 0 deletions lib/Bio/EnsEMBL/DataCheck/Checks/ExonRank.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
=head1 LICENSE
Copyright [2018] 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::ExonRank;

use warnings;
use strict;
use Bio::EnsEMBL::DataCheck::Test::DataCheck;

use Moose;
use Test::More;

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

use constant {
NAME => 'ExonRank',
DESCRIPTION => 'Check for entries in the exon_transcript table that are duplicates apart from the rank',
GROUPS => [ 'core_handover' ],
DB_TYPES => [ 'core' ]
};

sub tests {
my ($self) = @_;

my $descexon_rank = 'Exon/Transcript rank count';
my $diagexon_rank = "Same Exon/Transcript with different ranks";
my $sqlexon_rank = qq/
SELECT exon_id,
transcript_id,
GROUP_CONCAT(`rank` SEPARATOR '-')
FROM exon_transcript
GROUP BY exon_id, transcript_id
HAVING COUNT(`rank`) > 1
/;
is_rows_zero($self->dba, $sqlexon_rank, $descexon_rank, $diagexon_rank);

}

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 @@ -195,6 +195,15 @@
"name" : "EpigenomeHasSegmentationFile",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::EpigenomeHasSegmentationFile"
},
"ExonRank" : {
"datacheck_type" : "critical",
"description" : "Check for entries in the exon_transcript table that are duplicates apart from the rank",
"groups" : [
"core_handover"
],
"name" : "ExonRank",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::ExonRank"
},
"ExperimentHasFeatureSet" : {
"datacheck_type" : "critical",
"description" : "Check that every distinct experiment, epigenome and feature_type combination is linked to a feature_set",
Expand Down

0 comments on commit 69b3559

Please sign in to comment.