@@ -94,7 +94,7 @@ large genomic datasets.
9494
9595Several simulation tools output tree sequences. Below we use the
9696standard library for population genetic simulation models
97- ([ stdpopsim] ( https://popsim-consortium.github.io/ ) ) to generate a model of
97+ ([ stdpopsim] ( https://popsim-consortium.github.io/stdpopsim-docs/ ) ) to generate a model of
9898* Homo sapiens* , in which African, Eurasian,
9999and Asian populations combine to generate a mixed American population. We can use the
100100[ demesdraw] ( https://pypi.org/project/demesdraw/ ) package to plot a schematic of the
@@ -107,7 +107,7 @@ import demesdraw
107107from matplotlib import pyplot as plt
108108
109109species = stdpopsim.get_species("HomSap")
110- model = species.get_demographic_model("AmericanAdmixture_4B11 ")
110+ model = species.get_demographic_model("AmericanAdmixture_4B18 ")
111111
112112# Plot a schematic of the model
113113demesdraw.tubes(model.model.to_demes(), ax=plt.gca(), seed=1, log_time=True)
@@ -125,7 +125,7 @@ succinct tree sequence named `ts`:
125125contig = species.get_contig("chr1", mutation_rate=model.mutation_rate, right=20_000)
126126samples = {"AFR": 4, "EUR": 4, "ASIA": 4, "ADMIX": 4} # 16 diploid samples
127127engine = stdpopsim.get_engine("msprime")
128- ts = engine.simulate(model, contig, samples, seed=9)
128+ ts = engine.simulate(model, contig, samples, seed=9).trim() # trim to first 20kb simulated
129129print(f"Simulated a tree sequence of {ts.num_samples} haploid genomes:")
130130print(f"{ts.num_sites} variable sites over {ts.sequence_length} base pairs")
131131```
0 commit comments