You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ancestry.md
+38-41Lines changed: 38 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1129,47 +1129,6 @@ However, if `coalescing_segments_only=False`, then the edges recorded
1129
1129
would be from `m` to `p` over the entire segment `[a, b)`, and from `n` to `p` over the entire segment `[c,d)`.
1130
1130
The nodes `m` and `n` coalesce (in `p`) on only the overlapping segment `[c,b)`, and so the node `p` will be a unary node in the flanking regions: above `m` on the segment `[a,c)` and above `n` on the segment `[b,d)`.
1131
1131
1132
-
(sec_simulation_after_mrca)=
1133
-
1134
-
### Simulations after local MRCA
1135
-
1136
-
By default, msprime stops simulating local trees when a local most recent common ancestor (MRCA) is found. This is because events that occur
1137
-
above the common ancestor are shared across all samples, and we are usually interested in differences between samples.
Here, for example, we see that simulations in the middle tree stopped at node 6, which is much younger than nodes 7 and 8.
1145
-
And if we look closely, we can also see that simulations stopped at node 7 in the rightmost tree at a younger time than
1146
-
node 8 in the leftmost tree.
1147
-
1148
-
1149
-
However, for some specialised applications, simulations after the local MRCA might be needed. In this case, we set the
1150
-
parameter `stop_at_local_mrca` of {func}`.sim_ancestry` to `False`, and we set the `end_time` parameter to stop simulations
1151
-
when they reach this end time.
1152
-
1153
-
1154
-
```{code-cell}
1155
-
import msprime
1156
-
1157
-
ts = msprime.sim_ancestry(
1158
-
2, recombination_rate=0.1,
1159
-
sequence_length=10,
1160
-
random_seed=21,
1161
-
stop_at_local_mrca=False,
1162
-
end_time=10)
1163
-
1164
-
ts.draw_svg(time_scale='rank')
1165
-
```
1166
-
It is possible to run the simulations without setting an `end_time`. In that case, simulations will
1167
-
stop when no more events (recombination, coalescence, migration, etc.) could happen. However, since in many cases this state is impossible to reach, we recommend setting an `end_time`.
1168
-
1169
-
Note that you might want to set an `end_time` that is larger than possible end times for your simulations to avoid stopping
1170
-
your simulations before full coalescence. However, a larger `end_time` means that simulations will take longer and consume
1171
-
more memory.
1172
-
1173
1132
1174
1133
(sec_additional_nodes_ca)=
1175
1134
@@ -1522,6 +1481,44 @@ Migrations nodes are also recorded in the ARG using the
1522
1481
`NodeType.MIGRANT` flag. See the {ref}`sec_api_node_flags`
1523
1482
section for more details.
1524
1483
1484
+
(sec_simulation_after_mrca)=
1485
+
1486
+
### Simulations after local MRCA
1487
+
1488
+
By default, msprime stops simulating local trees when a local most recent
1489
+
common ancestor (MRCA) is found. This is because events that occur above the
1490
+
common ancestor are shared across all samples, and we are usually interested in
1491
+
differences between samples.
1492
+
1493
+
However, for some specialised applications, simulations after the local MRCA
1494
+
might be needed. In this case, we set the parameter `stop_at_local_mrca` of
0 commit comments