def test_smc_variants(self): for model in ["smc", "smc_prime"]: threshold = 20 sim = ancestry._parse_simulate(sample_size=10, recombination_rate=5, model=model) sim.run() self.assertGreater(sim.num_rejected_common_ancestor_events, 0) self.assertGreater(sim.num_common_ancestor_events, threshold) self.assertGreater(sim.num_recombination_events, threshold)
def test_smc_variants(self): for model in ["smc", "smc_prime"]: threshold = 20 sim = ancestry._parse_simulate(sample_size=10, recombination_rate=5, model=model, random_seed=432) sim.run() assert sim.num_rejected_common_ancestor_events > 0 assert sim.num_common_ancestor_events > threshold assert sim.num_recombination_events > threshold
def test_hudson(self): threshold = 20 sim = ancestry._parse_simulate( sample_size=10, recombination_rate=10, random_seed=32, ) sim.run() assert sim.num_common_ancestor_events > threshold assert sim.num_recombination_events > threshold assert sim.num_rejected_common_ancestor_events == 0 sim2 = ancestry._parse_simulate( sample_size=10, recombination_rate=10, model="hudson", random_seed=32, ) sim2.run() assert sim2.num_common_ancestor_events == sim.num_common_ancestor_events assert sim2.num_recombination_events == sim.num_recombination_events assert sim2.num_rejected_common_ancestor_events == 0
def test_hudson(self): threshold = 20 sim = ancestry._parse_simulate( sample_size=10, recombination_rate=10, random_generator=_msprime.RandomGenerator(2), ) sim.run() self.assertGreater(sim.num_common_ancestor_events, threshold) self.assertGreater(sim.num_recombination_events, threshold) self.assertEqual(sim.num_rejected_common_ancestor_events, 0) sim2 = ancestry._parse_simulate( sample_size=10, recombination_rate=10, model="hudson", random_generator=_msprime.RandomGenerator(2), ) sim2.run() self.assertEqual(sim2.num_common_ancestor_events, sim.num_common_ancestor_events) self.assertEqual(sim2.num_recombination_events, sim.num_recombination_events) self.assertEqual(sim2.num_rejected_common_ancestor_events, 0)