Skip to content

Commit

Permalink
use provided index, first _affected_, or first
Browse files Browse the repository at this point in the history
  • Loading branch information
tedil committed Nov 8, 2024
1 parent 181d9ca commit 0e78d9b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion varfish_cli/cli/importer/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,11 @@ def strip_suffix(x):
name, self.pedigree = self._load_pedigree()
if self.index and self.index not in {member.name for member in self.pedigree}:
raise ValueError(f"Specified index case '{self.index}' not found in pedigree")
index = self.index or self.pedigree[0].name
# use provided index member, first affected member or first general member as index
index = (
self.index
or next(filter(lambda m: m.affected == 2, self.pedigree), self.pedigree[0]).name
)
name = strip_suffix(name)

self._check_genotypes()
Expand Down

0 comments on commit 0e78d9b

Please sign in to comment.