Skip to content

Commit

Permalink
update solve_status reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
hanars committed Mar 7, 2024
1 parent aab7868 commit 98d4c01
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
18 changes: 9 additions & 9 deletions seqr/views/apis/report_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
{'column': 'affected_status', 'required': True, 'data_type': 'enumeration', 'enumerations': ['Affected', 'Unaffected', 'Unknown']},
{'column': 'phenotype_description'},
{'column': 'age_at_enrollment'},
{'column': 'solve_status', 'required': True, 'data_type': 'enumeration', 'enumerations': ['Yes', 'Likely', 'No', 'Partial']},
{'column': 'solve_status', 'required': True, 'data_type': 'enumeration', 'enumerations': ['Solved', 'Partially solved', 'Probably solved', 'Unsolved', 'Unaffected']},
{'column': 'missing_variant_case', 'required': True, 'data_type': 'enumeration', 'enumerations': ['Yes', 'No']},
],
},
Expand Down Expand Up @@ -505,7 +505,7 @@
'phenotype_description': None,
'pmid_id': None,
'seqr_chosen_consequence': None,
'solve_status': 'No',
'solve_status': 'Unsolved',
'svName': None,
'svType': None,
'sv_name': None,
Expand Down Expand Up @@ -589,7 +589,7 @@ def test_anvil_export(self, mock_google_authenticated, mock_zip):
'dbgap_subject_id_1', 'No', '1', 'NA19678', 'NA19679', '-', 'Self', 'Male', 'Middle Eastern or North African', '-', '-',
'-', 'OMIM:615120', 'Myasthenic syndrome, congenital, 8, with pre- and postsynaptic defects',
'Affected', 'Adult onset', '-', 'HP:0001631|HP:0002011|HP:0001636', 'HP:0011675|HP:0001674|HP:0001508',
'myopathy', 'No'], subject_file)
'myopathy', 'Unsolved'], subject_file)

self.assertEqual(sample_file[0], [
'entity:sample_id', '01-subject_id', '02-sample_id', '03-dbgap_sample_id', '04-sequencing_center',
Expand Down Expand Up @@ -809,23 +809,23 @@ def _assert_expected_gregor_files(self, mock_open, has_second_project=False):
self.assertListEqual([
'Broad_NA19675_1', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', 'Yes', 'IKBKAP|CCDC102B|CMA - normal',
'34415322', 'Broad_1', 'Broad_NA19678', 'Broad_NA19679', '', 'Self', '', 'Male', '',
'Middle Eastern or North African', '', '', '21', 'Affected', 'myopathy', '18', 'No', 'No',
'Middle Eastern or North African', '', '', '21', 'Affected', 'myopathy', '18', 'Unsolved', 'No',
], row)
hispanic_row = next(r for r in participant_file if r[0] == 'Broad_HG00731')
self.assertListEqual([
'Broad_HG00731', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', '', '', '', 'Broad_2', 'Broad_HG00732',
'Broad_HG00733', '', 'Self', '', 'Female', '', '', 'Hispanic or Latino', 'Other', '', 'Affected', '', '', 'No', 'No',
'Broad_HG00733', '', 'Self', '', 'Female', '', '', 'Hispanic or Latino', 'Other', '', 'Affected', '', '', 'Unsolved', 'No',
], hispanic_row)
solved_row = next(r for r in participant_file if r[0] == 'Broad_NA20876')
self.assertListEqual([
'Broad_NA20876', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', '', '', '', 'Broad_7', '0',
'0', '', '', '', 'Male', '', '', '', '', '', 'Affected', '', '', 'Yes', 'No',
'0', '', '', '', 'Male', '', '', '', '', '', 'Affected', '', '', 'Solved', 'No',
], solved_row)
multi_data_type_row = next(r for r in participant_file if r[0] == 'Broad_NA20888')
self.assertListEqual([
'Broad_NA20888', 'Broad_Test Reprocessed Project' if has_second_project else 'Broad_1kg project nme with unide',
'BROAD', 'HMB', 'No', '', '', 'Broad_12' if has_second_project else 'Broad_8', '0', '0', '', '', '',
'Male' if has_second_project else 'Female', '', '', '', '', '', 'Affected', '', '', 'No', 'No',
'Male' if has_second_project else 'Female', '', '', '', '', '', 'Affected', '', '', 'Unsolved', 'No',
], multi_data_type_row)

self.assertEqual(len(family_file), 11 if has_second_project else 10)
Expand Down Expand Up @@ -1076,7 +1076,7 @@ def test_family_metadata(self):
'familyGuid': 'F000012_12',
'family_id': '12',
'displayName': '12',
'solve_status': 'No',
'solve_status': 'Unsolved',
'actual_inheritance': 'unknown',
'date_data_generation': '2017-02-05',
'data_type': 'WES',
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def test_family_metadata(self):
'familyGuid': 'F000003_3',
'family_id': '3',
'displayName': '3',
'solve_status': 'No',
'solve_status': 'Unsolved',
'actual_inheritance': '',
'date_data_generation': '2017-02-05',
'data_type': 'WES',
Expand Down
4 changes: 2 additions & 2 deletions seqr/views/apis/summary_data_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
EXPECTED_NO_AIRTABLE_SAMPLE_METADATA_ROW = {
"projectGuid": "R0003_test",
"num_saved_variants": 2,
"solve_status": "No",
"solve_status": "Unsolved",
"sample_id": "NA20889",
"gene_known_for_phenotype-1": "Known",
"gene_known_for_phenotype-2": "Known",
Expand Down Expand Up @@ -143,7 +143,7 @@
'pmid_id': None,
'proband_relationship': 'Self',
'sex': 'Female',
'solve_status': 'No',
'solve_status': 'Unsolved',
'alt-1': 'T',
'chrom-1': '1',
'gene_known_for_phenotype-1': 'Candidate',
Expand Down
10 changes: 6 additions & 4 deletions seqr/views/utils/anvil_metadata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
}

SOLVE_STATUS_LOOKUP = {
**{s: 'Yes' for s in Family.SOLVED_ANALYSIS_STATUSES},
**{s: 'Likely' for s in Family.STRONG_CANDIDATE_ANALYSIS_STATUSES},
Family.ANALYSIS_STATUS_PARTIAL_SOLVE: 'Partial',
**{s: 'Solved' for s in Family.SOLVED_ANALYSIS_STATUSES},
Family.ANALYSIS_STATUS_PARTIAL_SOLVE: 'Partially solved',
Family.ANALYSIS_STATUS_PROBABLE_SOLVE: 'Probably solved',
}

MIM_INHERITANCE_MAP = {
Expand Down Expand Up @@ -103,7 +103,7 @@ def _get_family_metadata(family_filter, family_fields, include_metadata, include
for f in family_data:
family_id = f.pop('id')
f.update({
'solve_status': SOLVE_STATUS_LOOKUP.get(f['analysisStatus'], 'No'),
'solve_status': SOLVE_STATUS_LOOKUP.get(f['analysisStatus'], 'Unsolved'),
**{k: v['format'](f) for k, v in (family_fields or {}).items()},
})
if format_id:
Expand Down Expand Up @@ -201,6 +201,8 @@ def parse_anvil_metadata(
if individual.id in matchmaker_individuals:
subject_row['MME'] = matchmaker_individuals[individual.id] if mme_values else 'Yes'
subject_row.update(family_subject_row)
if individual.affected != Individual.AFFECTED_STATUS_AFFECTED:
subject_row['solve_status'] = 'Unaffected'
add_row(subject_row, family_id, SUBJECT_ROW_TYPE)

participant_id = subject_row['participant_id']
Expand Down

0 comments on commit 98d4c01

Please sign in to comment.