Skip to content

Commit

Permalink
Merge pull request #4418 from broadinstitute/sex-aneuploidy
Browse files Browse the repository at this point in the history
Sex aneuploidy
  • Loading branch information
hanars authored Oct 22, 2024
2 parents b1db641 + 764376e commit fd3b005
Show file tree
Hide file tree
Showing 23 changed files with 121 additions and 51 deletions.
5 changes: 4 additions & 1 deletion matchmaker/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

class MatchmakerSubmission(ModelWithGUID):

SEX_LOOKUP = {Individual.SEX_MALE: 'MALE', Individual.SEX_FEMALE: 'FEMALE'}
SEX_LOOKUP = {
**{sex: 'MALE' for sex in Individual.MALE_SEXES},
**{sex: 'FEMALE' for sex in Individual.FEMALE_SEXES},
}

individual = models.OneToOneField(Individual, on_delete=models.PROTECT)

Expand Down
4 changes: 2 additions & 2 deletions seqr/fixtures/1kg_project.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
"individual_id": "NA19675_1",
"mother_id": 3,
"father_id": 2,
"sex": "M",
"sex": "XXY",
"affected": "A",
"display_name": "",
"notes": "",
Expand Down Expand Up @@ -536,7 +536,7 @@
"individual_id": "HG00731",
"mother_id": 6,
"father_id": 5,
"sex": "F",
"sex": "X0",
"affected": "A",
"proband_relationship": "S",
"display_name": "HG00731_a",
Expand Down
18 changes: 18 additions & 0 deletions seqr/migrations/0076_alter_individual_sex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.13 on 2024-10-10 20:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('seqr', '0075_alter_individual_primary_biosample'),
]

operations = [
migrations.AlterField(
model_name='individual',
name='sex',
field=models.CharField(choices=[('M', 'Male'), ('F', 'Female'), ('U', 'Unknown'), ('XXY', 'XXY'), ('XYY', 'XYY'), ('XXX', 'XXX'), ('X0', 'X0')], default='U', max_length=3),
),
]
8 changes: 7 additions & 1 deletion seqr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,16 @@ class Individual(ModelWithGUID):
SEX_MALE = 'M'
SEX_FEMALE = 'F'
SEX_UNKNOWN = 'U'
FEMALE_ANEUPLOIDIES = ['XXX', 'X0']
MALE_ANEUPLOIDIES = ['XXY', 'XYY']
FEMALE_SEXES = [SEX_FEMALE] + FEMALE_ANEUPLOIDIES
MALE_SEXES = [SEX_MALE] + MALE_ANEUPLOIDIES
SEX_CHOICES = (
(SEX_MALE, 'Male'),
('F', 'Female'),
('U', 'Unknown'),
*[(sex, sex) for sex in MALE_ANEUPLOIDIES],
*[(sex, sex) for sex in FEMALE_ANEUPLOIDIES],
)

AFFECTED_STATUS_AFFECTED = 'A'
Expand Down Expand Up @@ -603,7 +609,7 @@ class Individual(ModelWithGUID):
mother = models.ForeignKey('seqr.Individual', null=True, blank=True, on_delete=models.SET_NULL, related_name='maternal_children')
father = models.ForeignKey('seqr.Individual', null=True, blank=True, on_delete=models.SET_NULL, related_name='paternal_children')

sex = models.CharField(max_length=1, choices=SEX_CHOICES, default='U')
sex = models.CharField(max_length=3, choices=SEX_CHOICES, default='U')
affected = models.CharField(max_length=1, choices=AFFECTED_STATUS_CHOICES, default=AFFECTED_STATUS_UNKNOWN)

# TODO once sample and individual ids are fully decoupled no reason to maintain this field
Expand Down
2 changes: 1 addition & 1 deletion seqr/utils/search/hail_search_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _get_sample_data(samples, inheritance_filter=None, inheritance_mode=None, **
affected=F('individual__affected'),
)
if inheritance_mode == X_LINKED_RECESSIVE:
sample_values['is_male'] = Case(When(individual__sex=Individual.SEX_MALE, then=True), default=False)
sample_values['is_male'] = Case(When(individual__sex__in=Individual.MALE_SEXES, then=True), default=False)
sample_data = samples.order_by('guid').values('individual__individual_id', 'dataset_type', 'sample_type', **sample_values)

custom_affected = (inheritance_filter or {}).pop('affected', None)
Expand Down
2 changes: 1 addition & 1 deletion seqr/views/apis/anvil_workspace_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def _assert_valid_operation(self, project, test_add_data=True):
['R0001_1kg', 'F000001_1', '1', 'NA19675_1', 'NA19678', '', 'F'],
['R0001_1kg', 'F000001_1', '1', 'NA19678', '', '', 'M'],
['R0001_1kg', 'F000001_1', '1', 'NA19679', '', '', 'F'],
['R0001_1kg', 'F000002_2', '2', 'HG00731', 'HG00732', 'HG00733', 'F'],
['R0001_1kg', 'F000002_2', '2', 'HG00731', 'HG00732', 'HG00733', 'X0'],
['R0001_1kg', 'F000002_2', '2', 'HG00732', '', '', 'M'],
['R0001_1kg', 'F000002_2', '2', 'HG00733', '', '', 'F'],
['R0001_1kg', 'F000003_3', '3', 'NA20870', '', '', 'M'],
Expand Down
4 changes: 2 additions & 2 deletions seqr/views/apis/data_manager_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@

PEDIGREE_HEADER = ['Project_GUID', 'Family_GUID', 'Family_ID', 'Individual_ID', 'Paternal_ID', 'Maternal_ID', 'Sex']
EXPECTED_PEDIGREE_ROWS = [
['R0001_1kg', 'F000001_1', '1', 'NA19675_1', 'NA19678', 'NA19679', 'M'],
['R0001_1kg', 'F000001_1', '1', 'NA19675_1', 'NA19678', 'NA19679', 'XXY'],
['R0001_1kg', 'F000001_1', '1', 'NA19678', '', '', 'M'],
['R0001_1kg', 'F000001_1', '1', 'NA19679', '', '', 'F'],
['R0001_1kg', 'F000002_2', '2', 'HG00731', 'HG00732', 'HG00733', 'F'],
['R0001_1kg', 'F000002_2', '2', 'HG00731', 'HG00732', 'HG00733', 'X0'],
]

PROJECT_OPTION = {
Expand Down
6 changes: 0 additions & 6 deletions seqr/views/apis/individual_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
from seqr.views.utils.individual_utils import delete_individuals, add_or_update_individuals_and_families
from seqr.views.utils.variant_utils import bulk_create_tagged_variants

_SEX_TO_EXPORTED_VALUE = dict(Individual.SEX_LOOKUP)
_SEX_TO_EXPORTED_VALUE['U'] = ''

__AFFECTED_TO_EXPORTED_VALUE = dict(Individual.AFFECTED_STATUS_LOOKUP)
__AFFECTED_TO_EXPORTED_VALUE['U'] = ''


@login_and_policies_required
def update_individual_handler(request, individual_guid):
Expand Down
10 changes: 7 additions & 3 deletions seqr/views/apis/individual_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ def test_individuals_table_handler_errors(self):

rows += [
'"1" "NA19675_1" "NA19675_1" "F" "Father"',
'"2" "NA19675_2" "NA19675_1" "M" ""',
'"2" "NA19675_2" "NA19675_1" "XXX" "Nephew"',
'"2" "NA19677" "NA19675_2" "M" ""',
]
response = self.client.post(individuals_url, {
'f': SimpleUploadedFile('test.tsv', '\n'.join(rows).encode('utf-8'))})
Expand All @@ -463,8 +464,10 @@ def test_individuals_table_handler_errors(self):
'Invalid proband relationship "Father" for NA19675_1 with given gender Female',
'NA19675_1 is recorded as their own father',
'NA19675_1 is recorded as Female sex and also as the father of NA19675_1',
'Invalid proband relationship "Nephew" for NA19675_2 with given gender XXX',
'NA19675_1 is recorded as Female sex and also as the father of NA19675_2',
'NA19675_1 is recorded as the father of NA19675_2 but they have different family ids: 1 and 2',
'NA19675_2 is recorded as XXX sex and also as the father of NA19677',
'NA19675_1 is included as 2 separate records, but must be unique within the project',
],
'warnings': [missing_entry_warning],
Expand All @@ -477,7 +480,7 @@ def test_individuals_table_handler(self):

data = 'Family ID Individual ID Previous Individual ID Paternal ID Maternal ID Sex Affected Status Notes familyNotes\n\
"1" " NA19675_1 " "" "NA19678 " "NA19679" "Female" "Affected" "A affected individual, test1-zsf" ""\n\
"1" "NA19678" "" "" "" "Male" "Unaffected" "a individual note" ""\n\
"1" "NA19678" "" "" "" "XXY" "Unaffected" "a individual note" ""\n\
"4" "NA20872_update" "NA20872" "" "" "Male" "Affected" "" ""\n\
"21" " HG00735" "" "" "" "Female" "Unaffected" "" "a new family""'

Expand Down Expand Up @@ -525,6 +528,7 @@ def test_individuals_table_handler(self):
self.assertEqual(response_json['individualsByGuid']['I000001_na19675']['sex'], 'F')
self.assertEqual(
response_json['individualsByGuid']['I000001_na19675']['notes'], 'A affected individual, test1-zsf')
self.assertEqual(response_json['individualsByGuid']['I000002_na19678']['sex'], 'XXY')
self.assertEqual(response_json['individualsByGuid'][new_indiv_guid]['individualId'], 'HG00735')
self.assertEqual(response_json['individualsByGuid'][new_indiv_guid]['sex'], 'F')
self.assertEqual(response_json['individualsByGuid']['I000008_na20872']['individualId'], 'NA20872_update')
Expand Down Expand Up @@ -899,7 +903,7 @@ def _is_expected_individuals_metadata_upload(self, response, expected_families=F
response_json['individualsByGuid']['I000001_na19675']['absentFeatures'],
[{'id': 'HP:0012469', 'category': 'HP:0025031', 'label': 'Infantile spasms'}]
)
self.assertEqual(response_json['individualsByGuid']['I000001_na19675']['sex'], 'M')
self.assertEqual(response_json['individualsByGuid']['I000001_na19675']['sex'], 'XXY')
self.assertEqual(response_json['individualsByGuid']['I000001_na19675']['birthYear'], 2000)
self.assertTrue(response_json['individualsByGuid']['I000001_na19675']['affectedRelatives'])
self.assertEqual(response_json['individualsByGuid']['I000001_na19675']['onsetAge'], 'J')
Expand Down
8 changes: 4 additions & 4 deletions seqr/views/apis/report_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,11 @@
'missing_variant_case',
], [
'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', '',
'34415322', 'Broad_1', 'Broad_NA19678', 'Broad_NA19679', '', 'Self', '', 'Male', 'XXY',
'Middle Eastern or North African', '', '', '21', 'Affected', 'myopathy', '18', 'Unsolved', 'No',
], [
'Broad_HG00731', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', '', '', '', 'Broad_2', 'Broad_HG00732',
'Broad_HG00733', '', 'Self', '', 'Female', '', '', 'Hispanic or Latino', 'Other', '', 'Affected',
'Broad_HG00733', '', 'Self', '', 'Female', 'X0', '', 'Hispanic or Latino', 'Other', '', 'Affected',
'microcephaly; seizures', '', 'Unsolved', 'No',
], [
'Broad_HG00732', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', '', '', '', 'Broad_2', '0', '0', '',
Expand Down Expand Up @@ -875,14 +875,14 @@ def _test_gregor_export(self, url, mock_subprocess, mock_temp_dir, mock_open, mo
[c for c in PARTICIPANT_TABLE[0] if c not in {'pmid_id', 'ancestry_detail', 'age_at_last_observation', 'missing_variant_case'}],
[
'Broad_NA19675_1', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', 'Yes', 'IKBKAP|CCDC102B|CMA - normal',
'Broad_1', 'Broad_NA19678', 'Broad_NA19679', '', 'Self', '', 'Male', '', 'Middle Eastern or North African',
'Broad_1', 'Broad_NA19678', 'Broad_NA19679', '', 'Self', '', 'Male', 'XXY', 'Middle Eastern or North African',
'', 'Affected', 'myopathy', '18', 'Unsolved',
], [
'Broad_NA19678', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', '', '', 'Broad_1', '0', '0', '', '',
'', 'Male', '', '', '', 'Unaffected', 'myopathy', '', 'Unaffected',
], [
'Broad_HG00731', 'Broad_1kg project nme with unide', 'BROAD', 'HMB', '', '', 'Broad_2', 'Broad_HG00732',
'Broad_HG00733', '', 'Self', '', 'Female', '', '', 'Hispanic or Latino', 'Affected',
'Broad_HG00733', '', 'Self', '', 'Female', 'X0', '', 'Hispanic or Latino', 'Affected',
'microcephaly; seizures', '', 'Unsolved',
]], additional_calls=10)
self._assert_expected_file(read_file, [READ_TABLE_HEADER, [
Expand Down
2 changes: 2 additions & 0 deletions seqr/views/apis/summary_data_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
'seqr_chosen_consequence-1': 'intron_variant',
"ancestry": "Ashkenazi Jewish",
"sex": "Female",
'sex_detail': None,
"chrom-1": "1",
"alt-1": "T",
"gene_of_interest-1": "OR4G11P",
Expand Down Expand Up @@ -154,6 +155,7 @@
'pmid_id': None,
'proband_relationship': 'Self',
'sex': 'Female',
'sex_detail': None,
'solve_status': 'Unsolved',
'alt-1': 'T',
'chrom-1': '1',
Expand Down
2 changes: 1 addition & 1 deletion seqr/views/apis/variant_search_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ def test_variant_lookup(self, mock_variant_lookup):
'vlmContactEmail': 'test@broadinstitute.org,vlm@broadinstitute.org',
},
'I2_F0_1-10439-AC-A': {
'affected': 'A', 'familyGuid': 'F0_1-10439-AC-A', 'individualGuid': 'I2_F0_1-10439-AC-A', 'sex': 'F',
'affected': 'A', 'familyGuid': 'F0_1-10439-AC-A', 'individualGuid': 'I2_F0_1-10439-AC-A', 'sex': 'X0',
'features': [{'category': 'HP:0000707', 'label': '1 terms'}, {'category': 'HP:0001626', 'label': '1 terms'}],
'vlmContactEmail': 'test@broadinstitute.org,vlm@broadinstitute.org',
},
Expand Down
13 changes: 11 additions & 2 deletions seqr/views/utils/anvil_metadata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _get_genotype_zygosity(genotype, individual=None, variant=None):
num_alt = genotype.get('numAlt')
cn = genotype.get('cn')
if num_alt == 2 or cn == 0 or (cn != None and cn > 3):
return HEMI if (variant or {}).get('chrom') == 'X' and individual.sex == Individual.SEX_MALE else HOM_ALT
return HEMI if (variant or {}).get('chrom') == 'X' and individual.sex in Individual.MALE_SEXES else HOM_ALT
if num_alt == 1 or cn == 1 or cn == 3:
return HET
return None
Expand Down Expand Up @@ -420,9 +420,18 @@ def _get_transcript_field(field, config, transcript):
def _get_subject_row(individual, has_dbgap_submission, airtable_metadata, individual_ids_map, get_additional_individual_fields, format_id):
paternal_ids = individual_ids_map.get(individual.father_id, ('', ''))
maternal_ids = individual_ids_map.get(individual.mother_id, ('', ''))
sex = individual.sex
sex_detail = None
if sex in Individual.MALE_ANEUPLOIDIES:
sex_detail = sex
sex = Individual.SEX_MALE
elif sex in Individual.FEMALE_ANEUPLOIDIES:
sex_detail = sex
sex = Individual.SEX_FEMALE
subject_row = {
'participant_id': format_id(individual.individual_id),
'sex': Individual.SEX_LOOKUP[individual.sex],
'sex': Individual.SEX_LOOKUP[sex],
'sex_detail': sex_detail,
'reported_race': ANCESTRY_MAP.get(individual.population, ''),
'ancestry_detail': ANCESTRY_DETAIL_MAP.get(individual.population, ''),
'reported_ethnicity': ETHNICITY_MAP.get(individual.population, ''),
Expand Down
7 changes: 0 additions & 7 deletions seqr/views/utils/individual_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
from seqr.views.utils.pedigree_info_utils import JsonConstants


_SEX_TO_EXPORTED_VALUE = dict(Individual.SEX_LOOKUP)
_SEX_TO_EXPORTED_VALUE['U'] = ''

__AFFECTED_TO_EXPORTED_VALUE = dict(Individual.AFFECTED_STATUS_LOOKUP)
__AFFECTED_TO_EXPORTED_VALUE['U'] = ''


def _get_record_family_id(record):
# family id will be in different places in the json depending on whether it comes from a flat uploaded file or from the nested individual object
return record.get(JsonConstants.FAMILY_ID_COLUMN) or record.get('family', {})['familyId']
Expand Down
18 changes: 9 additions & 9 deletions seqr/views/utils/pedigree_info_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _parse_sex(sex):
return 'F'
elif sex == '0' or not sex or sex.lower() in {'unknown', 'prefer_not_answer'}:
return 'U'
return None
return Individual.SEX_LOOKUP.get(sex)


def _parse_affected(affected):
Expand Down Expand Up @@ -292,15 +292,15 @@ def validate_fam_file_records(project, records, fail_on_warnings=False, errors=N
# check proband relationship has valid gender
if r.get(JsonConstants.PROBAND_RELATIONSHIP) and r.get(JsonConstants.SEX_COLUMN):
invalid_choices = {}
if r[JsonConstants.SEX_COLUMN] == Individual.SEX_MALE:
if r[JsonConstants.SEX_COLUMN] in Individual.MALE_SEXES:
invalid_choices = Individual.FEMALE_RELATIONSHIP_CHOICES
elif r[JsonConstants.SEX_COLUMN] == Individual.SEX_FEMALE:
elif r[JsonConstants.SEX_COLUMN] in Individual.FEMALE_SEXES:
invalid_choices = Individual.MALE_RELATIONSHIP_CHOICES
if invalid_choices and r[JsonConstants.PROBAND_RELATIONSHIP] in invalid_choices:
message = 'Invalid proband relationship "{relationship}" for {individual_id} with given gender {sex}'.format(
relationship=Individual.RELATIONSHIP_LOOKUP[r[JsonConstants.PROBAND_RELATIONSHIP]],
individual_id=individual_id,
sex=dict(Individual.SEX_CHOICES)[r[JsonConstants.SEX_COLUMN]]
sex=Individual.SEX_LOOKUP[r[JsonConstants.SEX_COLUMN]]
)
if clear_invalid_values:
r[JsonConstants.PROBAND_RELATIONSHIP] = None
Expand All @@ -310,8 +310,8 @@ def validate_fam_file_records(project, records, fail_on_warnings=False, errors=N

# check maternal and paternal ids for consistency
for parent in [
('father', JsonConstants.PATERNAL_ID_COLUMN, 'M'),
('mother', JsonConstants.MATERNAL_ID_COLUMN, 'F')
('father', JsonConstants.PATERNAL_ID_COLUMN, Individual.MALE_SEXES),
('mother', JsonConstants.MATERNAL_ID_COLUMN, Individual.FEMALE_SEXES)
]:
_validate_parent(r, *parent, individual_id, family_id, records_by_id, warnings, errors, clear_invalid_values)

Expand Down Expand Up @@ -345,7 +345,7 @@ def get_valid_hpo_terms(records, additional_feature_columns=None):
return set(HumanPhenotypeOntology.objects.filter(hpo_id__in=all_hpo_terms).values_list('hpo_id', flat=True))


def _validate_parent(row, parent_id_type, parent_id_field, expected_sex, individual_id, family_id, records_by_id, warnings, errors, clear_invalid_values):
def _validate_parent(row, parent_id_type, parent_id_field, expected_sexes, individual_id, family_id, records_by_id, warnings, errors, clear_invalid_values):
parent_id = row.get(parent_id_field)
if not parent_id:
return
Expand All @@ -367,8 +367,8 @@ def _validate_parent(row, parent_id_type, parent_id_field, expected_sex, individ
# is father male and mother female?
if JsonConstants.SEX_COLUMN in records_by_id[parent_id]:
actual_sex = records_by_id[parent_id][JsonConstants.SEX_COLUMN]
if actual_sex != expected_sex:
actual_sex_label = dict(Individual.SEX_CHOICES)[actual_sex]
if actual_sex not in expected_sexes:
actual_sex_label = Individual.SEX_LOOKUP[actual_sex]
errors.append(
"%(parent_id)s is recorded as %(actual_sex_label)s sex and also as the %(parent_id_type)s of %(individual_id)s" % locals())

Expand Down
18 changes: 18 additions & 0 deletions ui/pages/Project/components/FamilyTable/IndividualRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ const IndividualContainer = styled.div`

const PaddedRadioButtonGroup = styled(RadioButtonGroup)`
padding: 10px;
.button {
padding-left: 1em !important;
padding-right: 1em !important;
&.labeled .label {
margin-left: 0px !important;
}
}
`

const POPULATION_MAP = {
Expand Down Expand Up @@ -414,6 +423,8 @@ const CASE_REVIEW_FIELDS = [
...INDIVIDUAL_FIELDS,
]

const INDIVIDUAL_FIELD_CONFIG_SEX = INDIVIDUAL_FIELD_CONFIGS[INDIVIDUAL_FIELD_SEX]

const NON_CASE_REVIEW_FIELDS = [
{
component: OptionFieldView,
Expand All @@ -430,6 +441,13 @@ const NON_CASE_REVIEW_FIELDS = [
isVisible: caseReviewStatus === CASE_REVIEW_STATUS_MORE_INFO_NEEDED,
}),
},
{
field: INDIVIDUAL_FIELD_SEX,
fieldName: INDIVIDUAL_FIELD_CONFIG_SEX.label,
isEditable: false,
component: OptionFieldView,
tagOptions: INDIVIDUAL_FIELD_CONFIG_SEX.formFieldProps.options,
},
...[
INDIVIDUAL_FIELD_ANALYTE_TYPE,
INDIVIDUAL_FIELD_PRIMARY_BIOSAMPLE,
Expand Down
5 changes: 3 additions & 2 deletions ui/pages/Project/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
INDIVIDUAL_HAS_DATA_FIELD,
MME_TAG_NAME,
TISSUE_DISPLAY,
SIMPLIFIED_SEX_LOOKUP,
} from 'shared/utils/constants'
import { toCamelcase, toSnakecase, snakecaseToTitlecase } from 'shared/utils/stringUtils'

Expand Down Expand Up @@ -639,8 +640,8 @@ export const getParentOptionsByIndividual = createSelector(
...individuals.reduce((indAcc, { individualGuid }) => ({
...indAcc,
[individualGuid]: {
M: individuals.filter(i => i.sex === 'M' && i.individualGuid !== individualGuid).map(individualOption),
F: individuals.filter(i => i.sex === 'F' && i.individualGuid !== individualGuid).map(individualOption),
M: individuals.filter(i => SIMPLIFIED_SEX_LOOKUP[i.sex] === 'M' && i.individualGuid !== individualGuid).map(individualOption),
F: individuals.filter(i => SIMPLIFIED_SEX_LOOKUP[i.sex] === 'F' && i.individualGuid !== individualGuid).map(individualOption),
},
}), {}),
}), {}),
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/SummaryData/components/IndividualMetadata.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const CORE_COLUMNS = [
{ name: 'paternal_id', secondaryExportColumn: 'paternal_guid' },
{ name: 'maternal_id', secondaryExportColumn: 'maternal_guid' },
{ name: 'proband_relationship' },
{ name: 'sex' },
{ name: 'sex', format: ({ sex, sex_detail: sexDetail }) => (sexDetail ? `${sex} (${sexDetail})` : sex) },
{ name: 'ancestry' },
{ name: 'affected_status' },
{ name: 'hpo_present', style: { minWidth: '400px' } },
Expand Down
Loading

0 comments on commit fd3b005

Please sign in to comment.