Revision f47a92088a16a0f4fd7ca66acdd847d3ebc60e42 authored by Jerome Kelleher on 03 March 2021, 12:43:15 UTC, committed by GitHub on 03 March 2021, 12:43:15 UTC
Make newick import optional for conda package.
run_old_msprime.py
"""
Runs the parameters for a given simulation in an input
pickle file and writes the output tree sequence to
an output file.
"""
import pickle
import sys
import msprime
if __name__ == "__main__":
assert msprime.__version__ == "0.7.4"
if len(sys.argv) != 4:
raise ValueError(
"Usage: python3 run_old_msprime.py <num_replicates> "
"<params file> <output prefix>"
)
num_replicates = int(sys.argv[1])
with open(sys.argv[2], "rb") as f:
kwargs = pickle.load(f)
output_prefix = sys.argv[3]
kwargs["num_replicates"] = num_replicates
for j, ts in enumerate(msprime.simulate(**kwargs)):
ts.dump(f"{output_prefix}_{j}.trees")
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...