-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.py
More file actions
31 lines (26 loc) · 723 Bytes
/
example.py
File metadata and controls
31 lines (26 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import msprime
import random
import tskit_arg_visualizer
# Generate a random tree sequence with record_full_arg=True so that you get marked recombination nodes
ts_rs = random.randint(0,10000)
print(ts_rs)
ts = msprime.sim_ancestry(
samples=5,
recombination_rate=1e-8,
sequence_length=3_000,
population_size=10_000,
record_full_arg=True,
random_seed=ts_rs
)
ts = msprime.sim_mutations(ts, rate=1e-7, random_seed=4321)
print(ts)
#print(ts.tables.mutations)
d3arg = tskit_arg_visualizer.D3ARG.from_ts(ts=ts, progress=True)
print(d3arg.draw_node(
seed_nodes=20,
depth=5,
rotate_tip_labels=True,
show_mutations=True,
condense_mutations=False,
return_included_nodes=True
))