The nice logic around retaining mutations or not means that we're throwing out uneeded bits in two ways: retaining mutations, and at simplification. However, retaining is assuming that we will simplify in the future, which is optional. So this recipe:
initialize()
{
setSeed(23);
initializeSLiMOptions(keepPedigrees=T);
initializeTreeSeq(simplificationRatio=INF, timeUnit="generations");
initializeMutationRate(1e-2);
initializeMutationType("m1", 0.5, "f", -0.1);
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 99);
initializeRecombinationRate(1e-2);
}
1 early() {
sim.addSubpop("p1", 10);
}
10 late() {
sim.treeSeqOutput("out.trees", simplify=F);
}
produces a tree sequence for which not all mutations have information, as seen as follows:
import tskit
ts = tskit.load("out.trees")
md = { x['mutation_id'] : x for x in ts.metadata['SLiM_mutation_list'] }
ds = [ int(j) for x in ts.mutations_derived_state for j in x.split(",") ]
for k in ds:
assert k in md, f"missing {k}"
Another way to get to this error would be to (a) write out the tree sequence without simplification; (b) use pyslim to mark more individuals as samples; (c) try to read it back into SLiM, who would now have the "unknown mutation" error.
The nice logic around retaining mutations or not means that we're throwing out uneeded bits in two ways: retaining mutations, and at simplification. However, retaining is assuming that we will simplify in the future, which is optional. So this recipe:
produces a tree sequence for which not all mutations have information, as seen as follows:
Another way to get to this error would be to (a) write out the tree sequence without simplification; (b) use pyslim to mark more individuals as samples; (c) try to read it back into SLiM, who would now have the "unknown mutation" error.