Skip to content

Commit

Permalink
allow probands in multigenerational families
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymcrae committed Mar 17, 2018
1 parent 704381e commit 2e8ba01
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions peds/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,20 @@ def get_probands(family):
# arbitrarily define probands as individuals who are affected, and do
# not have any children in the family. This could be a bit looser,
# to cope with multigenerational familes, but will do for now.
if x.is_affected() and len(list(family.get_children(x))) == 0:
probands.append(x)
if x.is_affected():
if len(list(family.get_children(x))) == 0:
probands.append(x)
else:
mom = family.get_mother(x)
dad = family.get_father(x)

if mom is None or dad is None:
continue

# ignore people whose parents are based on their own ped line
if mom._is_inferred() or dad._is_inferred():
continue

probands.append(x)

return probands

0 comments on commit 2e8ba01

Please sign in to comment.