Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator update: only allow SOMATIC or GERMLINE values for SV_Status column #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/importer/validateData.py
Original file line number Diff line number Diff line change
Expand Up @@ -3217,8 +3217,9 @@ def checkNCBIbuild(ncbi_build):
def checkSVstatus(sv_status):
""" Allowed values for SV_Status column are SOMATIC and GERMLINE """
if sv_status is None:
self.logger.warning('No value in SV_Status, assuming the variant is SOMATIC',
extra={'line_number': self.line_number})
self.logger.error('Invalid SV_Status value: possible values are [SOMATIC, GERMLINE]',
extra={'line_number': self.line_number,
'cause': sv_status})
elif sv_status.lower() == 'germline':
self.logger.warning('GERMLINE variant identified from the SV_Status value. If this variant is not meant for public release, please remove it.',
extra={'line_number': self.line_number,
Expand Down
8 changes: 7 additions & 1 deletion tests/unit_tests_validate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2023,9 +2023,15 @@ def test_missing_values(self):
self.logger.setLevel(logging.ERROR)
record_list = self.validate('data_structural_variants_missing_values.txt',
validateData.StructuralVariantValidator)
self.assertEqual(2, len(record_list))
self.assertEqual(3, len(record_list))
record_iterator = iter(record_list)

# Expected first error due to a SV_Status being empty
record = next(record_iterator)
self.assertEqual(logging.ERROR, record.levelno)
self.assertEqual(3, record.line_number)
self.assertIn("Invalid SV_Status value: possible values are [SOMATIC, GERMLINE]", record.message)

# Expected ERROR message due to missing Entrez gene id and/or gene symbol at site 1 and site 2
record = next(record_iterator)
self.assertEqual(logging.ERROR, record.levelno)
Expand Down
Loading