Skip to content

Version 4.2

Compare
Choose a tag to compare
@bhaller bhaller released this 22 Mar 13:47
· 124 commits to master since this release
6d00ad3

Hi folks! SLiM 4.2 has just been released. This is a major point release with some new features that I've been wanting to do for a long time. It should preserve backward compatibility with SLiM 4.1 in most, but not all, cases (models that run in 4.1 will continue to run with few or no changes). Similarly, it preserves backward reproducibility (the same model with the same seed will produce the same results) in most, but not all, cases. I would recommend that everyone should upgrade to this version; it has several important bug fixes, and seems quite stable in testing. See the new SLiM manual (chapter 30) and the VERSIONS file for a complete list of changes, which will be summarized here.

Recommended python package versions are tskit 0.5.6, msprime 1.3.1 (but back to 1.2.0 should be fine for SLiM), and pyslim 1.0.4. Note that there was an important bug in pyslim from versions 0.700 through 1.0.2, so you should DEFINITELY be on the latest version of pyslim; more information on that bug can be found in Peter's posts here: https://groups.google.com/g/slim-discuss/c/Rtkkx_8pW58/m/SpuaxFSgAAAJ.

NEW FEATURES:

  • SLiMgui now supports custom plotting, with the addition of a new Plot class (which exists only when running in SLiMgui). This is similar to base plotting in R, although much less full-featured. Recipes 13.5, 13.7, 14.7, and 15.17 demonstrate this new custom plotting facility; have a look at them to see what is possible.

  • SLiMgui also now supports plotting of data recorded by a LogFile. You can create such a plot in the user interface, directly from the debug output window, from a context menu. Recipes 4.2.5 and 15.16 demonstrate this new capability. It is now also possible to access logged data in script, with a new logFileData() method, to produce a custom plot (only in SLiMgui).

  • The tick range for event and callback declarations, which specify which ticks the event/callback should run in, can now contain arbitrary Eidos expressions, can use defined constants (as long as they exist by the end of the last initialize() callback), and no longer need to be consecutive. Needing to use rescheduleScriptBlock() to dynamically schedule events and callbacks is now largely a thing of the past! So legal event declarations would include N:(N+M+2) early(), seq(1, 100, by=5) early(), and c(5, 50, 500) early(), among many other possibilities. Recipes 4.1.10 and 17.4 now demonstrate the use of such tick range expressions, and sections 20.2 and 26.1 provide relevant documentation.

  • Eidos for loops now support multiple in clauses, so a loop like for (x in 1:3, y in 2:4) { ... } is now legal. All in clauses must entail the same number of iterations, and are executed concurrently. This is very useful for iterating over multiple vectors in a synchronized fashion. Recipes 10.5, 14.7, and 19.7 now demonstrate this new for loop syntax.

  • A new method on Subpopulation, deviatePositions(), makes it even easier and more efficient to move individuals around in continuous-space models; recipe 16.3 now demonstrates this.

  • External editors are now better supported by SLiMgui. If you edit a SLiM model externally, SLiMgui will notice the change and offer to reload the model from disk. In SLiMgui's Preferences panel, you can even configure SLiMgui to reload external changes automatically, as long as there is not a conflict between internal and external changes.

These are only the most notable new features; see the full release notes in the SLiM manual for more.

IMPORTANT POLICY CHANGES:

  • Indices of type float are no longer legal for subsetting a vector with operator []. The ability to subset with float indices was inherited from R, and seems unwise. Existing code that uses float indices will need to convert to integer with asInteger(), perhaps after calling round().

  • Assignment into a property of an object must now match the type of the property; type promotion will no longer occur. Existing code that now errors should use asInteger(), asFloat(), etc. as needed.

IMPORTANT BUG FIXES:

  • A very large memory leak when reading a tree-sequence file into SLiM in some cases has been fixed. Memory usage, for models that encountered this bug, may now be MUCH lower.

  • Writing to a file with writeFile(), with the combination of append=T and compress=T, could silently fail to write the data -- but only in SLiMgui, and only if a partial path rather than an absolute path was used.

  • Adding a null genome to a subpopulation in nonWF models could crash in some cases.

See full release notes in the SLiM manual regarding less prominent bug fixes.

NEW/REVISED RECIPES:

Recipe revisions were extensive for this release, with changes to show off many of the new features that were added, as described above. I would recommend looking at recipes 4.1.10, 13.7, and 14.7 in particular, to see important new features demonstrated.

And as always, if your own model is based upon a recipe in the manual, it is wise to review that foundational recipe in each new SLiM release to see if improvements or fixes have been made. Recipes have changed beyond those cited here.

INSTALLATION NOTES:

  • If you are on Fedora, RedHat, CentOS, openSUSE, or SUSE Linux Enterprise, the SLiM installer for your Linux platform has already been updated, and installs both the command-line slim binary and the SLiMgui app; see section 2.2.2.

  • If you are on Debian or Ubuntu, there is a Bash script that installs both the command-line slim binary and the SLiMgui app; see section 2.2.2.

  • The manual discusses using another method, AppImage, to install SLiMgui (only – no command-line tools) on Linux platforms, since it is the most difficult target to build. However, AppImage is proving a bit finicky to configure, and is not yet ready to use. PLEASE DISREGARD that manual section until further notice. Hopefully it will be working soon.

  • If you are on macOS, download the double-click installer from the SLiM home page at http://messerlab.org/slim/.

  • If you are on Windows, the pacman installer will be somewhat delayed as usual; a followup post will be made here when it is ready, and in the meantime you can build from sources.

  • If you are on Arch, the installer is delayed a bit; in the meantime, you can use conda or build from sources.

  • For those using conda, the new version is now available for all platforms (but does not give you SLiMgui, only slim).

Everyone else can download the SLiM.zip source archive from the SLiM home page and build it themselves, or build from sources using the git tag associated with the SLiM 4.2 release.

The manuals, recipes, and reference sheets have undergone revisions, so you should re-download those too.

SLIM BEGINNERS: Note that a free SLiM Workshop is available online at http://benhaller.com/workshops/workshops.html, and is highly recommended for new users. It has been updated to SLiM 4; an update to SLiM 4.2 will happen, hopefully soon, but the changes will be minor. It is offered occasionally in person, and as of this posting there are a few spaces left in the upcoming Ancona, Italy, workshop on May 27-31; see the slim-discuss list for workshop announcements.

If you have any questions, comments, etc., please use the slim-discuss group for that. Thanks, and happy modeling!

Cheers,

Benjamin C. Haller
Messer Lab
Cornell University