-
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.
Health check DescriptionNewlines converted to datacheck
- Loading branch information
Vinay Kaikala
committed
Mar 17, 2020
1 parent
63d968e
commit 10da1c5
Showing
2 changed files
with
77 additions
and
8 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,52 @@ | ||
=head1 LICENSE | ||
Copyright [2018-2020] 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::DescriptionNewlines; | ||
|
||
use warnings; | ||
use strict; | ||
|
||
use Moose; | ||
use Test::More; | ||
use Bio::EnsEMBL::DataCheck::Test::DataCheck; | ||
|
||
extends 'Bio::EnsEMBL::DataCheck::DbCheck'; | ||
|
||
use constant { | ||
NAME => 'DescriptionNewlines', | ||
DESCRIPTION => 'Check for newlines and tabs in gene descriptions', | ||
GROUPS => ['xref'], | ||
DATACHECK_TYPE => 'critical', | ||
TABLES => ['gene'] | ||
}; | ||
|
||
sub tests { | ||
my ($self) = @_; | ||
|
||
my $desc_1 = 'gene description does not contain newlines and/or tabs'; | ||
my $sql_1 = qq/ | ||
SELECT COUNT(*) | ||
FROM gene | ||
WHERE (LOCATE('\n', description) > 0 OR LOCATE('\t', description) > 0) | ||
/; | ||
|
||
is_rows_zero($self->dba, $sql_1, $desc_1); | ||
} | ||
|
||
1; | ||
|
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