Skip to content

Commit 8dc2300

Browse files
hyanwongbenjeffery
authored andcommitted
Allow tutes to work with stdpopsim3
1 parent b9dd5a3 commit 8dc2300

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

popgen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ large genomic datasets.
9494

9595
Several simulation tools output tree sequences. Below we use the
9696
standard 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,
9999
and 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
107107
from matplotlib import pyplot as plt
108108
109109
species = 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
113113
demesdraw.tubes(model.model.to_demes(), ax=plt.gca(), seed=1, log_time=True)
@@ -125,7 +125,7 @@ succinct tree sequence named `ts`:
125125
contig = species.get_contig("chr1", mutation_rate=model.mutation_rate, right=20_000)
126126
samples = {"AFR": 4, "EUR": 4, "ASIA": 4, "ADMIX": 4} # 16 diploid samples
127127
engine = 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
129129
print(f"Simulated a tree sequence of {ts.num_samples} haploid genomes:")
130130
print(f"{ts.num_sites} variable sites over {ts.sequence_length} base pairs")
131131
```

requirements-CI.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ numpy==1.26.4
99
pandas==2.2.2
1010
pygraphviz==1.13
1111
scikit-allel==1.3.8
12-
stdpopsim==0.2.0
12+
stdpopsim==0.3.0
1313
tqdm==4.66.3
1414
tskit==0.5.8
1515
tskit_arg_visualizer==0.0.1

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ networkx
88
pandas
99
pygraphviz
1010
scikit-allel
11-
stdpopsim
11+
stdpopsim>=0.3
1212
tqdm
1313
tskit>=0.5.4
1414
tskit_arg_visualizer

0 commit comments

Comments
 (0)