Closed ivan-krukov closed 4 years ago
Trying to sample a haploid path:
ped = Pedigree.from_balsac_table('data/test/simple.tsv') tr = ped.sample_path(ploidy=1)
Leads to an error in get_parents:
get_parents
UnboundLocalError Traceback (most recent call last) <ipython-input-374-5e6e17e6d5d4> in <module> ----> 1 ped.sample_path() ~/work/genealogies/genealogy_aligner/Pedigree.py in sample_path(self, probands, ploidy) 534 for hap_obj, parent in zip( 535 hap_struct[n], --> 536 rnd.choice(self.get_parents(n), 2, replace=False)): 537 538 # If the parent is a node in the pedigree: ~/work/genealogies/genealogy_aligner/Pedigree.py in get_parents(self, n) 169 father, mother = rnd.choice(pred, 2, replace=False) 170 --> 171 return father, mother 172 173 UnboundLocalError: local variable 'father' referenced before assignment
Apropos: what are some "standard" paths through our code? We should document and test them
This issue doesn't replicate for me in the latest update. There was an issue earlier in get_parents() where the variable father was inadvertently changed to fapther.
get_parents()
father
fapther
Trying to sample a haploid path:
Leads to an error in
get_parents
:Apropos: what are some "standard" paths through our code? We should document and test them