Skip to content

Commit

Permalink
Merge bfb6526 into c59936e
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmaurel committed Sep 9, 2019
2 parents c59936e + bfb6526 commit dabe3e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
34 changes: 22 additions & 12 deletions ...EnsEMBL/DataCheck/Checks/XrefHTMLBlank.pm → ...io/EnsEMBL/DataCheck/Checks/XrefFormat.pm
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
=cut

package Bio::EnsEMBL::DataCheck::Checks::XrefHTMLBlank;
package Bio::EnsEMBL::DataCheck::Checks::XrefFormat;

use warnings;
use strict;
Expand All @@ -28,8 +28,8 @@ use Bio::EnsEMBL::DataCheck::Test::DataCheck;
extends 'Bio::EnsEMBL::DataCheck::DbCheck';

use constant {
NAME => 'XrefHTMLBlank',
DESCRIPTION => 'Xrefs dont have HTML markups nor blank rows',
NAME => 'XrefFormat',
DESCRIPTION => 'Xrefs do not have HTML markup, non-printing characters, or blank values',
GROUPS => ['xref'],
DB_TYPES => ['core'],
TABLES => ['xref'],
Expand All @@ -39,22 +39,32 @@ use constant {
sub tests {
my ($self) = @_;

my $desc = 'No xrefs appear to have HTML markup in the display_label';
my $diag = 'Xrefs appear to have HTML markup (<*>*</*>) in the display_label';
my $sql = qq/
my $desc_1 = 'No xrefs appear to have HTML markup in the display_label';
my $diag_1 = 'HTML markup';
my $sql_1 = qq/
SELECT display_label FROM xref
WHERE display_label LIKE '%<%>%<\/%>%'/;

is_rows_zero($self->dba, $sql, $desc, $diag);
is_rows_zero($self->dba, $sql_1, $desc_1, $diag_1);

foreach my $column ('dbprimary_acc','display_label'){
my $desc = "$column has no empty string values";
my $sql = qq/
SELECT COUNT(*) FROM xref
my $desc_2 = "$column has no empty string values";
my $diag_2 = 'Empty value';
my $sql_2 = qq/
SELECT dbprimary_acc,display_label FROM xref
WHERE $column = ''
/;
is_rows_zero($self->dba, $sql, $desc);
is_rows_zero($self->dba, $sql_2, $desc_2, $diag_2);
}

my $desc_3 = 'No xrefs descriptions have newlines, tabs or carriage returns';
my $diag_3 = 'Non-printing character';
my $sql_3 = qq/
SELECT dbprimary_acc,display_label FROM xref
WHERE description like '%\r%' or description like '%\n%' or description like '%\t%'
/;

is_rows_zero($self->dba, $sql_3, $desc_3, $diag_3);
}

1;
1;
8 changes: 4 additions & 4 deletions lib/Bio/EnsEMBL/DataCheck/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1433,14 +1433,14 @@
"name" : "VariationSubset",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::VariationSubset"
},
"XrefHTMLBlank" : {
"XrefFormat" : {
"datacheck_type" : "critical",
"description" : "Xrefs dont have HTML markups nor blank rows",
"description" : "Xrefs do not have HTML markup, non-printing characters, or blank values",
"groups" : [
"xref"
],
"name" : "XrefHTMLBlank",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::XrefHTMLBlank"
"name" : "XrefFormat",
"package_name" : "Bio::EnsEMBL::DataCheck::Checks::XrefFormat"
},
"XrefPrefixes" : {
"datacheck_type" : "critical",
Expand Down

0 comments on commit dabe3e1

Please sign in to comment.