Hi Débora,
SLiM always outputs the whole tree sequence. That said, though, I did
see a cute trick in a model I was looking at just today (by Perry Xu at
Cornell); typing into this message (i.e., the below is untested code and
might contain typos), it looked like this IIRC:
sim.treeSeqRememberIndividuals(inds_I_want);
sim.killIndividuals(sim.subpopulations.individuals);
sim.treeSeqOutput(...);
So, remember the individuals you want, then kill everybody, then output
the tree-seq file. Since treeSeqOutput() performs a simplify, the
individuals you didn't remember get stripped away prior to writing.
Seems like it ought to work fine, if that is the result you want. Maybe
Peter will have more thoughts on this approach? I haven't tried it
myself, but it seems like it ought to work, and I guess it has been
working for Perry. :->
In any case you can always subset down to the individuals you want on
the Python side. :->
Happy modeling!
Cheers,
-B.
Benjamin C. Haller
Messer Lab
Cornell University
Débora Brandt wrote on 6/25/24 11:39 AM: