From 4879c39262cdc2b96b310d360150780f179bc255 Mon Sep 17 00:00:00 2001 From: Hana Snow Date: Mon, 18 Mar 2024 17:16:31 -0400 Subject: [PATCH] update tests --- seqr/views/apis/report_api_tests.py | 6 +++--- seqr/views/utils/anvil_metadata_utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/seqr/views/apis/report_api_tests.py b/seqr/views/apis/report_api_tests.py index 647ff3d730..f37031f63b 100644 --- a/seqr/views/apis/report_api_tests.py +++ b/seqr/views/apis/report_api_tests.py @@ -447,7 +447,7 @@ 'participant': { 'internal_project_id': {'data_type': 'reference'}, 'prior_testing': {'data_type': 'enumeration'}, - 'proband_relationship': {'required': True}, + 'proband_relationship': {'required': 'CONDITIONAL (sex = Male)'}, 'reported_race': {'enumerations': ['Asian', 'White', 'Black']}, 'age_at_enrollment': {'data_type': 'date'} }, @@ -717,7 +717,7 @@ def test_gregor_export(self, mock_subprocess, mock_temp_dir, mock_open, mock_dat ] + [ 'The following tables are required in the data model but absent from the reports: subject, dna_read_data_set', ] + [ - 'The following entries are missing required "proband_relationship" in the "participant" table: Broad_HG00732, Broad_HG00733, Broad_NA19678, Broad_NA19679, Broad_NA20870, Broad_NA20872, Broad_NA20874, Broad_NA20875, Broad_NA20876, Broad_NA20881, Broad_NA20888', + 'The following entries are missing required "proband_relationship" in the "participant" table: Broad_HG00732, Broad_NA19678, Broad_NA20870, Broad_NA20872, Broad_NA20874, Broad_NA20875, Broad_NA20876, Broad_NA20881', 'The following entries have invalid values for "reported_race" in the "participant" table. Allowed values: Asian, White, Black. Invalid values: Broad_NA19675_1 (Middle Eastern or North African)', 'The following entries have invalid values for "age_at_enrollment" in the "participant" table. Allowed values have data type date. Invalid values: Broad_NA19675_1 (18)', 'The following entries have invalid values for "reference_assembly" (from Airtable) in the "aligned_dna_short_read" table. Allowed values have data type integer. Invalid values: NA20888 (GRCh38), VCGS_FAM203_621_D2 (GRCh38)', @@ -1126,7 +1126,7 @@ def test_family_metadata(self): 'consanguinity': 'Unknown', 'condition_id': 'OMIM:615123', 'known_condition_name': '', - 'condition_inheritance': '', + 'condition_inheritance': 'Unknown', }) # Test empty project diff --git a/seqr/views/utils/anvil_metadata_utils.py b/seqr/views/utils/anvil_metadata_utils.py index 800887229e..4ba6094f0e 100644 --- a/seqr/views/utils/anvil_metadata_utils.py +++ b/seqr/views/utils/anvil_metadata_utils.py @@ -565,5 +565,5 @@ def _format_omim_conditions(conditions): 'known_condition_name': '|'.join(sorted({o['phenotype_description'] for o in conditions if o.get('phenotype_description')})), 'condition_inheritance': '|'.join(sorted({ MIM_INHERITANCE_MAP.get(i, i) for o in conditions if o.get('phenotype_inheritance') for i in o['phenotype_inheritance'].split(', ') - })) + })) or 'Unknown', }