Skip to content

Commit

Permalink
test fixture update - family and individual IDs from Metamist Pedigre…
Browse files Browse the repository at this point in the history
…e are always Strings
  • Loading branch information
MattWellie committed Oct 28, 2024
1 parent e81db47 commit 4c1375c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions cpg_workflows/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def populate_pedigree(dataset: Dataset) -> None:
Populate pedigree data for sequencing groups.
"""

sg_by_participant_id = dict()
sg_by_participant_id = {}
for sg in dataset.get_sequencing_groups():
sg_by_participant_id[sg.participant_id] = sg

Expand All @@ -299,13 +299,11 @@ def populate_pedigree(dataset: Dataset) -> None:
continue

ped_entry = ped_entry_by_participant_id[sequencing_group.participant_id]
maternal_sg = sg_by_participant_id.get(ped_entry['maternal_id'])
paternal_sg = sg_by_participant_id.get(ped_entry['paternal_id'])
sequencing_group.pedigree = PedigreeInfo(
sequencing_group=sequencing_group,
fam_id=ped_entry['family_id'],
mom=maternal_sg,
dad=paternal_sg,
mom=sg_by_participant_id.get(ped_entry['maternal_id']),
dad=sg_by_participant_id.get(ped_entry['paternal_id']),
sex=Sex.parse(str(ped_entry['sex'])),
phenotype=ped_entry['affected'] or '0',
)
Expand Down
6 changes: 3 additions & 3 deletions test/test_cohort.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ def mock_get_analysis_by_sgs(*args, **kwargs) -> dict:
def mock_get_pedigree(*args, **kwargs): # pylint: disable=unused-argument
return [
{
'family_id': 123,
'family_id': '123',
'individual_id': '8',
'paternal_id': 14,
'paternal_id': '14',
'maternal_id': None,
'sex': 1,
'affected': 1,
},
{
'family_id': 124,
'family_id': '124',
'individual_id': '14',
'paternal_id': None,
'maternal_id': None,
Expand Down

0 comments on commit 4c1375c

Please sign in to comment.