def test_half_sib(self): relat_sim = HamadryasSim() relat_pop = HamaPopulation() group = HamadryasGroup(1) relat_pop.groupsdict[1] = group self.setup(relat_sim, relat_pop, group) R = relatedness.calc_relatedness( [relat_pop.dict[4], relat_pop.dict[5]], relat_sim.parent_dict) self.assertEqual(R, 0.25)
def test_full_grandniece(self): relat_sim = HamadryasSim() relat_pop = HamaPopulation() group = HamadryasGroup(1) relat_pop.groupsdict[1] = group self.setup(relat_sim, relat_pop, group) R = relatedness.calc_relatedness( [relat_pop.dict[9], relat_pop.dict[15]], relat_sim.parent_dict) self.assertEqual(R, 0.125)