Beispiel #1
0
 def test_simulation_runs(self):
     model = drosophila_melanogaster.SheehanSongThreeEpoch()
     samples = [
         msprime.Sample(population=0, time=0),
         msprime.Sample(population=0, time=0)
     ]
     ts = msprime.simulate(samples=samples, **model.asdict())
     self.assertEqual(ts.num_populations, 1)
Beispiel #2
0
 def test_debug_runs(self):
     model = drosophila_melanogaster.SheehanSongThreeEpoch()
     output = io.StringIO()
     model.debug(output)
     s = output.getvalue()
     self.assertGreater(len(s), 0)
Beispiel #3
0
"""
Example of using the stdpopsim library with msprime.
"""
import msprime


import stdpopsim
from stdpopsim import drosophila_melanogaster

chrom = drosophila_melanogaster.genome.chromosomes["chrX"]
recomb_map = chrom.recombination_map()

model = drosophila_melanogaster.SheehanSongThreeEpoch()
model.debug()

samples = [msprime.Sample(population=0, time=0),msprime.Sample(population=0,
                                                               time=0)]

ts = msprime.simulate(
    samples=samples,
    recombination_map=chrom.recombination_map(),
    mutation_rate=chrom.mean_mutation_rate,
    **model.asdict())
print("simulated:", ts.num_trees, ts.num_sites)
 def test_qc_model_equal(self):
     model = drosophila_melanogaster.SheehanSongThreeEpoch()
     model_qc = drosophlia_melanogaster_qc.SheehanSongThreeEpic()
     self.assertTrue(model.equals(model_qc))