def test_individuals(self): from_ts = msprime.simulate(25, random_seed=5, __tmp_max_time=0.5) self.assertTrue(any(tree.num_roots > 1 for tree in from_ts.trees())) from_ts = tsutil.insert_random_ploidy_individuals(from_ts, seed=2) start_time = from_ts.tables.nodes.time.max() final_ts = msprime.simulate( from_ts=from_ts, start_time=start_time, random_seed=2) self.verify_from_tables(from_ts, final_ts, start_time) self.verify_simulation_completed(final_ts)
def test_individuals(self): from_ts = msprime.simulate(25, random_seed=5, end_time=0.5) self.assertTrue(any(tree.num_roots > 1 for tree in from_ts.trees())) from_ts = tsutil.insert_random_ploidy_individuals(from_ts, seed=2) start_time = from_ts.tables.nodes.time.max() final_ts = msprime.simulate(from_ts=from_ts, start_time=start_time, random_seed=2) self.verify_from_tables(from_ts, final_ts, start_time) self.verify_simulation_completed(final_ts)
def test_simple_jukes_cantor_random_ploidy(self): ts = msprime.simulate(10, random_seed=2) ts = tsutil.jukes_cantor(ts, num_sites=10, mu=1, seed=2) ts = tsutil.insert_random_ploidy_individuals(ts, min_ploidy=1) self.verify(ts)
def test_simple_infinite_sites_random_ploidy(self): ts = msprime.simulate(10, mutation_rate=1, random_seed=2) ts = tsutil.insert_random_ploidy_individuals(ts, min_ploidy=1) assert ts.num_sites > 2 self.verify(ts)