pyslim 1.1 beta release

18 views
Skip to first unread message

Peter Ralph

unread,
May 17, 2025, 10:21:48 AMMay 17
to 'Ben Haller' via slim-discuss
Hi all - there's been some changes to how SLiM stores tree sequences with SLiM v5, so I'm updating pyslim. If you'd like to try the new pyslim, install it like
  pip install pyslim==1.1b1
I'd appreciate bug reports, etcetera. If you are running single-chromosome simulations in which everyone is diploid, this should not affect you at all.

If you are running non-diploid simulations (eg sex chromosomes, haploids, etc), then you should be aware that the output contains "vacant" placeholder nodes that can cause errors or incorrect output, and these need to be removed from the sample for most downstream operations. pyslim.recapitate( ) does this automatically; if you don't use this function then you should probably use pyslim.remove_vacant. See https://tskit.dev/pyslim/docs/latest/previous_versions.html (and links therein) for more information.

Finally, if you are really getting into the details: the mechanism by which pyslim.remove_vacant stores information about which nodes were removed from the sample (in top-level metadata) is expected to change, so please don't rely on this. Otherwise, the effects and API are expected to be stable.

happy slimulating,
 Peter

Philip Wolper

unread,
May 20, 2025, 1:13:24 PMMay 20
to slim-discuss
Hi,

thanks for the update. Does calling ts.simplify() automatically remove vacant nodes as well? Not sure, where to find the docs you mentioned in https://github.com/tskit-dev/pyslim/pull/367, once they are finished?
 
Best,
Philip

Peter Ralph

unread,
May 20, 2025, 1:51:21 PMMay 20
to slim-discuss, Philip Wolper
The new docs are at
see in particular

And no - doing for instance
 ts = tskit.load("sim.trees")
 ts = ts.simplify(keep_input_roots=True)
will not remove the vacant sample nodes, because they are samples. If you do want to use simplify() to remove them, you would need to do something like:
 ts = pyslim.remove_vacant(ts).simplify(keep_input_roots=True)

(Recall that keep_input_roots=True is necessary if you're going to recapitate later.)

-p

From: 'Philip Wolper' via slim-discuss <slim-d...@googlegroups.com>
Sent: Tuesday, May 20, 2025 10:13 AM
To: slim-discuss <slim-d...@googlegroups.com>
Subject: Re: pyslim 1.1 beta release
 
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/slim-discuss/6244fd7c-63ba-4e7c-a39f-69457159b6f9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages