Skip to content

Instantly share code, notes, and snippets.

@andrewkern
Last active June 18, 2019 18:16
Show Gist options
  • Save andrewkern/82f00d24afa7d9a32e2529c162568cf7 to your computer and use it in GitHub Desktop.
Save andrewkern/82f00d24afa7d9a32e2529c162568cf7 to your computer and use it in GitHub Desktop.
import msprime
import stdpopsim
from stdpopsim import drosophila_melanogaster
chr_str = "chr2L"
genetic_map = stdpopsim.drosophila_melanogaster.Comeron2012_dm6()
genetic_map.download()
chrom = drosophila_melanogaster.genome.chromosomes[chr_str]
recomb_map = chrom.recombination_map()
print(f"Testing Li and Stephan (2006) model- with on {chr_str} map")
model = drosophila_melanogaster.LiStephanTwoPopulation()
model.debug()
samples = [msprime.Sample(population=0, time=0)] * 10 + [msprime.Sample(population=1, time=0)] * 10
ts = msprime.simulate(
samples=samples,
recombination_map=chrom.recombination_map(),
mutation_rate=chrom.default_mutation_rate,
**model.asdict())
print("simulated:", ts.num_trees, ts.num_sites)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment