Hi all,
I have a script in slim which sets up a neutral SLiM simulation with many subpopulations that runs for ~200 generations which outputs a tree sequence. Using pyslim and msprime, I recapitate the sequence until coalescence and then add mutations using msprime.sim_mutations.
My goal is to sample this history at a couple of points in time at subsets of the populations I have set up in SLiM using TreeSequence.samples(population, time) and calculate diversities at these sites. This works when time is 0 for all the sites I am sampling, but it suddenly stops working when I set time to anything greater than 0. Specifically when I run something like:
pi = ts.diversity([ts.samples(population=idx, time=8)])
I get this error:
raise ValueError("Sample sets must contain at least one element")
on the call for diversity().
Does anyone know why this might be? Is there something about the way tree sequences are stored that I'm not understanding?
I know this is more of a tskit question and now a SLiM one, but I didn't really know where else to ask this, sorry about that.
Thanks,
Sohan Alleshwaram