Skip to content

Commit

Permalink
Merge pull request #3489 from broadinstitute/write-pedigree-family-guid
Browse files Browse the repository at this point in the history
add family guid to write pedigree
  • Loading branch information
hanars authored Jul 14, 2023
2 parents 3430f1d + 57f50ce commit 8a7d768
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion seqr/views/apis/data_manager_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def write_pedigree(request, project_guid):
)

annotations = OrderedDict({
'Project_GUID': Value(project.guid), 'Family_ID': F('family__family_id'), 'Individual_ID': F('individual_id'),
'Project_GUID': Value(project.guid), 'Family_GUID': F('family__guid'), 'Family_ID': F('family__family_id'), 'Individual_ID': F('individual_id'),
'Paternal_ID': F('father__individual_id'), 'Maternal_ID': F('mother__individual_id'), 'Sex': F('sex'),
})
data = Individual.objects.filter(family__project=project).order_by('family_id', 'individual_id').values(**dict(annotations))
Expand Down
10 changes: 5 additions & 5 deletions seqr/views/apis/data_manager_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,11 +1175,11 @@ def test_write_pedigree(self, mock_subprocess, mock_temp_dir, mock_open):
file = [row.split('\t') for row in write_call.split('\n')]
self.assertEqual(len(file), 15)
self.assertListEqual(file[:5], [
['Project_GUID', 'Family_ID', 'Individual_ID', 'Paternal_ID', 'Maternal_ID', 'Sex'],
['R0001_1kg', '1', 'NA19675_1', 'NA19678', 'NA19679', 'M'],
['R0001_1kg', '1', 'NA19678', '', '', 'M'],
['R0001_1kg', '1', 'NA19679', '', '', 'F'],
['R0001_1kg', '2', 'HG00731', 'HG00732', 'HG00733', 'F'],
['Project_GUID', 'Family_GUID', 'Family_ID', 'Individual_ID', 'Paternal_ID', 'Maternal_ID', 'Sex'],
['R0001_1kg', 'F000001_1', '1', 'NA19675_1', 'NA19678', 'NA19679', 'M'],
['R0001_1kg', 'F000001_1', '1', 'NA19678', '', '', 'M'],
['R0001_1kg', 'F000001_1', '1', 'NA19679', '', '', 'F'],
['R0001_1kg', 'F000002_2', '2', 'HG00731', 'HG00732', 'HG00733', 'F'],
])

mock_subprocess.assert_has_calls(
Expand Down

0 comments on commit 8a7d768

Please sign in to comment.