Skip to content

Commit

Permalink
Merge pull request #3955 from broadinstitute/probably-solved
Browse files Browse the repository at this point in the history
Probably solved
  • Loading branch information
hanars authored Mar 7, 2024
2 parents a408953 + 98d4c01 commit d9284df
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# _seqr_ Changes

## dev
* Add "Probably Solved" analysis status (REQUIRES DB MIGRATION)

## 3/1/24
* Add subscribable project notifications (REQUIRES DB MIGRATION)
Expand Down
18 changes: 18 additions & 0 deletions seqr/migrations/0060_alter_family_analysis_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.23 on 2024-03-07 19:13

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('seqr', '0059_project_subscribers'),
]

operations = [
migrations.AlterField(
model_name='family',
name='analysis_status',
field=models.CharField(choices=[('S', 'S'), ('S_kgfp', 'S'), ('S_kgdp', 'S'), ('S_ng', 'S'), ('ES', 'E'), ('Sc_kgfp', 'S'), ('Sc_kgdp', 'S'), ('Sc_ng', 'S'), ('Rcpc', 'R'), ('Rncc', 'R'), ('C', 'C'), ('PB', 'P'), ('P', 'P'), ('I', 'A'), ('Q', 'W'), ('N', 'N')], default='Q', max_length=10),
),
]
2 changes: 2 additions & 0 deletions seqr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ def _compute_guid(self):
class Family(ModelWithGUID):
ANALYSIS_STATUS_ANALYSIS_IN_PROGRESS='I'
ANALYSIS_STATUS_PARTIAL_SOLVE = 'P'
ANALYSIS_STATUS_PROBABLE_SOLVE = 'PB'
ANALYSIS_STATUS_WAITING_FOR_DATA='Q'
SOLVED_ANALYSIS_STATUS_CHOICES = (
('S', 'Solved'),
Expand All @@ -297,6 +298,7 @@ class Family(ModelWithGUID):
('Rcpc', 'Reviewed, currently pursuing candidates'),
('Rncc', 'Reviewed, no clear candidate'),
('C', 'Closed, no longer under analysis'),
(ANALYSIS_STATUS_PROBABLE_SOLVE, 'Probably Solved'),
(ANALYSIS_STATUS_PARTIAL_SOLVE, 'Partial Solve - Analysis in Progress'),
(ANALYSIS_STATUS_ANALYSIS_IN_PROGRESS, 'Analysis in Progress'),
(ANALYSIS_STATUS_WAITING_FOR_DATA, 'Waiting for data'),
Expand Down
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
2 changes: 2 additions & 0 deletions ui/shared/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const FAMILY_STATUS_SOLVED_KNOWN_GENE_KNOWN_PHENOTYPE = 'S_kgfp'
const FAMILY_STATUS_SOLVED_KNOWN_GENE_DIFFERENT_PHENOTYPE = 'S_kgdp'
const FAMILY_STATUS_SOLVED_NOVEL_GENE = 'S_ng'
const FAMILY_STATUS_EXTERNAL_SOLVE = 'ES'
const FAMILY_STATUS_PROBABLE_SOLVE = 'PB'
const FAMILY_STATUS_STRONG_CANDIDATE_KNOWN_GENE_KNOWN_PHENOTYPE = 'Sc_kgfp'
const FAMILY_STATUS_STRONG_CANDIDATE_KNOWN_GENE_DIFFERENT_PHENOTYPE = 'Sc_kgdp'
const FAMILY_STATUS_STRONG_CANDIDATE_NOVEL_GENE = 'Sc_ng'
Expand All @@ -164,6 +165,7 @@ export const SELECTABLE_FAMILY_ANALYSIS_STATUS_OPTIONS = [
{ value: FAMILY_STATUS_SOLVED_KNOWN_GENE_DIFFERENT_PHENOTYPE, color: '#4CAF50', name: 'Solved - gene linked to different phenotype' },
{ value: FAMILY_STATUS_SOLVED_NOVEL_GENE, color: '#4CAF50', name: 'Solved - novel gene' },
{ value: FAMILY_STATUS_EXTERNAL_SOLVE, color: '#146917', name: 'External Solve' },
{ value: FAMILY_STATUS_PROBABLE_SOLVE, color: '#ACD657', name: 'Probably Solved' },
{ value: FAMILY_STATUS_STRONG_CANDIDATE_KNOWN_GENE_KNOWN_PHENOTYPE, color: '#CDDC39', name: 'Strong candidate - known gene for phenotype' },
{ value: FAMILY_STATUS_STRONG_CANDIDATE_KNOWN_GENE_DIFFERENT_PHENOTYPE, color: '#CDDC39', name: 'Strong candidate - gene linked to different phenotype' },
{ value: FAMILY_STATUS_STRONG_CANDIDATE_NOVEL_GENE, color: '#CDDC39', name: 'Strong candidate - novel gene' },
Expand Down

0 comments on commit d9284df

Please sign in to comment.