Releases: MesserLab/SLiM
Version 5.1
Hi everybody! SLiM 5.1 has just been released. This is a major point release, and has some nice new features. Please read carefully.
This is a recommended update for all users, due to some significant bug fixes and improvements (detailed below). Overall SLiM 5.0 proved to be stable; this release is expected to be even more so. See the Revision History section in the new SLiM manual (chapter 32) for a more complete list of changes (or the VERSIONS file for even more detail); the changes will be summarized here.
SLiM 5.1 should preserve backward compatibility with SLiM 5.0 in almost cases (models that run in 5.0 will continue to run with no changes). Similarly, it preserves backward reproducibility (the same model with the same seed will produce the same results) in almost all cases. The exception is the bug fix to initializeRecombinationRateFromFile() described below. Note that SLiM 5.0 did break backward compatibility and reproducibility with previous versions, however.
Recommended python package versions are tskit 0.6.2 or later, msprime 1.3.0 or later, and pyslim 1.1.0 or later. Note the pyslim 1.1.0 was only recently released; all users of SLiM 5.1 and later should update to it.
NEW FEATURES:
-
Support for matrices and arrays has been extended considerably. Eidos now has new functions tr(), outerProduct(), det(), inverse(), and matrixPow(), and cor() and cov() now support computing correlation/covariance matrices. A new asVector() method strips off matrix/array dimensions to provide a plain vector. Thanks to Vitor Sudbrack for the implementations of a few of these.
-
SLiM's population-genetics utility functions have been improved significantly. Functions calcDxy(), calcLD_D(), and calcLD_Rsquared() have been added thanks to Vitor Sudbrack, and calcFST() has been extended to support multiple chromosomes thanks to Peter Ralph.
-
Custom plotting functionality in SLiMgui, with the Plot class, has gotten several big improvements. New image() and matrix() methods of Plot allow plotting of raster data -- spatial maps, Image objects, and matrices. A new legendTitleEntry() method lets you add title lines to your plot legends. And, last but not least, support for transparency (alpha) has been added to abline(), lines(), points(), and text() for more sophisticated visual appearances.
-
New ways of subsetting matrices and arrays with the [] operator have been added to Eidos, following R's syntax for this. Specifically, (1) you can now subset a matrix or array with a conformable logical matrix/array to select specific elements; and (2) you can now subset a matrix or array with an integer matrix in which each row specifies the coordinates of a specific element to select. Both of these allow particular elements to be selected from a matrix/array in an efficient manner.
-
Support for uniparentally-transmitted chromosomes in hermaphrodites has been added; the omission of this from SLiM 5.0 was an oversight.
-
A new filter() function in Eidos can convolute a vector with a filter, similar to the filter() function in R; good for computing running averages and similar for plotting!
-
SLiM will now detect infinite loops in some situations in Eidos, such as in while and do-while loops, and terminate with an error rather than hanging forever. This can be turned off with a new option to initializeSLiMOptions() if it misbehaves (i.e., if you really want to loop millions of times).
-
New recipes 16.11 (on life-long monogamous mating) and 14.16 (on visualizing linkage disequilibrium) extend the manual.
IMPORTANT BUG FIXES:
-
Fixed #553, an off-by-one error in initializeRecombinationRateFromFile() that could result in a slightly incorrect recombination rate map.
-
Fixed #548, an error from calcFST() when a windowed range (start/end) was used.
-
Fixed #545, incorrect results from calcMeanFroh() in multi-chromosome models.
-
Fixed #522, the sourceSubpop pseudo-parameter was NULL in modifyChild() callbacks in all cases.
-
Fixed #549, a survival() callback that moved individuals to a new subpop could crash, only in models with null haplosomes.
-
Fixed #533, the Haplosome method nucleotides() with format="char" would cause crashes and/or data corruption.
There are more new features and bug fixes, but those are the big ones; again, see chapter 32 and the VERSIONS file for more complete information.
INSTALLATION NOTES:
-
If you are on Fedora, RedHat, CentOS, 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.1. HOWEVER, there is an unresolved build issue with openSUSE platforms; Bryce Carson writes: "For now, the only openSUSE with a successful build is Tumbleweed, so any openSUSE Leap 15.6 SLiM users we have would need to wait." (Note that openSUSE 15.4 and 15.5 have been discontinued.) Building from sources should work fine; 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.1.
-
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 [EDITED 24 September 2025] is now ready for use; see section 2.3.1.
-
If you are on Arch, the installer has already been updated; see section 2.2.1.
-
For those using conda, the new version is now available for all platforms (but does not give you SLiMgui, only slim); see section 2.5.
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 5.1 release, following the instructions for building from sources in chapter 2.
The manuals, recipes, and reference sheets have been updated and should be downloaded again.
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 is presently compatible with SLiM 5.0 and 5.1; an older edition of the workshop for SLiM 4.3 users is also available. The workshop is offered occasionally in person; watch the slim-discuss list for workshop announcements, or see https://messerlab.org/slim/#Workshops for workshops presently accepting applications.
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
Version 5.0
Hi everybody! SLiM 5.0 has just been released. This is a major release, so a lot has changed; please read carefully.
This is a recommended update for most users, due to some significant bug fixes and improvements (detailed below), but a LOT has changed under the hood so it is very possible that there will be kinks that need to be worked out. If you do not wish to be on the cutting edge, you might wait a bit. See the Revision History section in the new SLiM manual (chapter 32) for a more complete list of changes (or the VERSIONS file for even more detail); the changes will be summarized here.
SLiM 5.0 breaks backward compatibility with SLiM 4.3 for most models, due to widespread changes in SLiM's Eidos APIs – the names of classes, methods, properties, and so forth. The new SLiMgui included in SLiM 5.0 can autofix almost all of those issues for you; just open your old model, recycle, and run until you no longer get any errors. Once those API changes have been fixed in your script, SLiM 5.0 should be backward compatible for almost all models (models that run in 4.3 will continue to run with no further changes). Similarly, SLiM 5.0 preserves backward reproducibility with SLiM 4.3 (the same model with the same seed will produce the same results) for almost all models. The main exception is models that simulate the Y chromosome, using initializeSex("Y"); those should preserve backward compatibility, but not backward reproducibility.
Recommended python package versions are tskit 0.6.2 or later, msprime 1.3.0 or later, and pyslim 1.1 or later. The new version of pyslim is not yet released; an announcement will be made here when it is. In the interim, pyslim 1.0.4 can still be used for most purposes; Peter Ralph writes: "Recapitation will work properly for single-chromosome models; it just won't understand multi-chromosome models well, and won't be able to write out tree sequences (single or multi-chromosome) that can be read back in by SLiM."
Please admire the new cover art for the two manuals! They are by Ehouarn Le Faou, a PhD student at the Université de Lausanne. If you love them as I do, please email him at ehouarn.lefaou@unil.ch to tell him so. Furthermore, he says that he is interested in doing more work of this kind for other projects; feel free to reach out to him with ideas. Thanks Ehouarn!
NEW FEATURES:
-
The big new thing in SLiM 5.0 is support for multiple chromosomes, including models with both autosomes and sex chromosomes, both diploid and haploid chromosomes, and so forth. Sex chromosomes including XY, ZW, and UV are supported (and similar systems like X0). The new architecture should be quite flexible. It still does not, however, support ploidy levels above diploid. To learn about modeling multiple chromosomes in SLiM 5, read sections 1.5.1 and 8.3 of the SLiM manual; the latter section provides a bunch of new example recipes. There are several new methods to support the new paradigm (see chapter 32), output formats have changed in some cases to provide chromosome information (see chapter 28), and so forth.
-
Because of this architectural shift, there has been a terminological shift. Diploid individuals in SLiM used to contain two "genomes"; each "genome" contained the genetic information for one of the two copies of the simulated chromosome. In SLiM 5, individuals might contain many such objects, representing the genetics for the multiple chromosomes being simulated, so the term "genome" can no longer be used to refer to one such object containing the genetic information for one copy of one chromosome. There is, remarkably, no single-word term in biology for these genetic entities (really!), so we have coined a new term: "haplosome". This is the reason for the many changes in SLiM's APIs: "genome" has changed to "haplosome" throughout. Section 1.5.1 gives a much more detailed explanation of the rationale for this shift; please read it before you object. :->
-
In this new paradigm, tree-sequence recording now records a separate tree sequence for each chromosome being simulated. Under the hood, these tree sequences actually share a single node table, individual table, and population table for lower memory usage and other performance improvements, as well as to keep the tree sequences synchronized with each other so that they are easier to work with in Python. For single-chromosome models, really little has changed apart from tweaks to the saved metadata. For multiple-chromosome models, tree sequence information is now saved to a directory called a "trees archive" that contains a .trees file for each chromosome. Chapter 29 has details on tree-sequence metadata, trees archives, and so forth. The new version of pyslim will contain a vignette demonstrating how to work with multi-chromosome tree sequences on the Python side.
-
SLiMgui has lots of nice changes. It supports multi-chromosome models, and can show you all the chromosomes in the main simulation window or focus in on just one. In addition, it now lets you open up separate "Chromosome Display" windows that give you a separately configurable view onto one or all of the modeled chromosomes, for greater flexibility in model visualization. The haplotype plot also supports multiple chromosomes now. Besides multi-chrom stuff, it can now display a "page guide" in the script editor, at a configurable column/width (nice when preparing scripts for publication), and it now has a built-in color chart and plot symbol chart in the Help menu for quick reference.
-
The pop-gen utilities function suite has expanded, with new calcSFS() and calcMeanFroh() functions (for site frequency spectra and runs of homozygosity, respectively). The calcPi() and calcTajimasD() functions, which were new in 4.3 but incorrectly wired and non-functional, now work as well.
-
Built-in output/input methods have been markedly improved. The outputFull() method can now write out information about object tags and about substitutions, and the readFromPopulationFile() method can now read that information back in (if you tell outputFull() to save in binary format), allowing more complete information about the state of the simulation to be saved and restored. Other output methods can now write out object tag information as well. The Individual class now has new outputIndividuals() and outputIndividualsToVCF() methods that are optimal for writing individual-level information, especially from multi-chromosome models; and a new readIndividualsFromVCF() method can read multi-chromosome VCF data.
-
Spatial modeling capabilites have increased. The existing deviatePositions() method now supports “absorbing” boundaries for spatial movement; and a new deviatePositionsWithMap() method can use a spatial map to limit dispersal.
-
There are some nice new convenience methods and functions. New initializeRecombinationRateFromFile() and initializeMutationRateFromFile() functions make it easy to read rate maps from disk. A new rztpois() function in Eidos draws from the zero-truncated Poisson distribution. A new setValuesVectorized() method on Dictionary does vectorized value assignments, assigning a different singleton value to each dictionary in a vector of dictionaries. A new substitutionsOfType() method parallels mutationsOfType(), providing all substitutions of a given mutation type.
-
You can now see a progress bar at the command line when running
slim, by supplying -p or -progress as a command-line option. -
There are a bunch of new recipes, demonstrating multi-chromosome models and other new features. In addition, the manual has been reorganized somewhat, a chapter was split in two, and lots of recipe numbers changed; sorry if that proves confusing, but it should be much better in the long run.
There are quite a few more changes; again, see chapter 32 and the VERSIONS file for more complete information, including various "policy changes" that might break your script in certain narrow cases.
IMPORTANT BUG FIXES:
-
The calcPi() and calcTajimasD() functions now call the correct code (they were miswired in 4.3).
-
Several problems in SLiMgui have been fixed involving window positions and layering. These bugs could cause windows to be located off-screen, or to be shown underneath another window (and thus not be visible), leading to confusion.
-
SLiMgui's response to the script file being modified in an external editor was sometimes non-optimal, to put it politely. That logic should now be greatly improved; please let me know if there is still anything about the external editing experience that needs work.
-
Tracking and reporting of error positions in your script should work much better, especially in nested contexts such as errors inside user-defined functions.
INSTALLATION NOTES:
-
If you are on Fedora, RedHat, CentOS, 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.1. HOWEVER, there is an unresolved build issue with openSUSE platforms; Bryce Carson writes: "For now, the only openSUSE with a successful build is Tumbleweed, so any openSUSE Leap 15.6 SLiM users we have would need to wait." (Note that openSUSE 15.4 and 15.5 have been discontinued.) Building from sources should work fine; 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.1.
-
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 use conda or build from sources following section 2.3.2.
-
If you are on Arch, the installer has already been updat...
Version 4.3
Hi everybody! SLiM 4.3 has just been released. This is a major point release. It should preserve backward compatibility with SLiM 4.2 in all cases (models that run in 4.2 will continue to run with no changes). Similarly, it preserves backward reproducibility (the same model with the same seed will produce the same results) in all cases. It is recommended, but there might be new build/install issues with it due to some changes described below. 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 or later, msprime 1.3.0 or later, and pyslim 1.0.4.
NEW FEATURES:
-
SLiMgui now builds against Qt6 as well as Qt5 (Qt being the cross-platform widget kit that SLiMgui uses). This should have few visible consequences for most users, but it is important nonetheless because Qt5 is getting rather old and users have started to see bugs and compatibility problems resulting from that. Shifting over to Qt6 gives SLiMgui lots of bug fixes and modernization. If you use an installer, it should install using Qt6 automatically (unless perhaps your platform is so old that Qt6 is not supported). If you build SLiMgui yourself, you will need to ensure that Qt6 is installed on your machine (I have been testing with Qt 6.7.2, the current version as of this writing), and then CMake should automatically detect it and use it in most cases. The manual (chapter 2) has more information on building with Qt6 and troubleshooting problems that might occur; but hopefully this transition will be smooth for everyone.
-
Tick range expressions that schedule events/callbacks can now use symbolic constants that are defined later in the simulation. For example, an event that should run 10 ticks after the end of a burn-in period could be declared as
BURNIN_END+10 early() { ... }and will get scheduled whenever the constantBURNIN_ENDbecomes defined, allowing a variable-length burnin to be handled easily. -
calcPi()andcalcTajimasD()popgen utility functions have been added, thanks to Nick Bailey. [EDIT: Due to an error on my end, these new functions are wired up incorrectly, and do not produce the correct result. They should not be used. They will be fixed in the next release.] -
SLiMgui now displays the selected script block, to the right of the Jump menu; if you're in a
10 early()event, it will say "10 early()", making navigation around big script files easier. -
A new "Copy as HTML" menu item in SLiMgui can copy the selected chunk of script as HTML, including syntax coloring, making it easy to paste pretty, syntax-colored Eidos code into other documents.
-
Some users have been having display issues in SLiMgui due to some kind of OpenGL malfunction on their machine. If the chromosome view and individuals view don't display correctly for you, there is now a "Use OpenGL" checkbox in the Preferences; you can uncheck it to turn off OpenGL usage in SLiMgui, which appears to fix this problem.
IMPORTANT BUG FIXES:
-
The start/end parameters to
calcWattersonsTheta()to specify a window should now work correctly. -
sampleIndividuals()could occasionally crash due to an incorrectly sized buffer; that has been fixed. -
a couple of the built-in graphs in SLiMgui could occasionally crash; that has been fixed.
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.1. The installer has not been working for RHEL 8 for the past several releases; that issue has now been fixed, thanks to the labors of Bryce Carson.
-
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.1.
-
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 was somewhat delayed as usual; it was released on 14 October 2024.
-
If you are on Arch, the installer has already been updated; see section 2.2.1.
-
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.3 release, following the instructions for building from sources in chapter 2.
The manuals, recipes, and reference sheets have been updated and should be downloaded again.
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 is compatible with SLiM 4.3. It is offered occasionally in person; watch the slim-discuss list for workshop announcements, or see https://messerlab.org/slim/#Workshops for workshops presently accepting applications.
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
Version 4.2.2
Hi folks! SLiM 4.2.2 has just been released. This is a bug fix release. It should preserve backward compatibility with SLiM 4.2 in all cases (models that run in 4.2 will continue to run with no changes). Similarly, it preserves backward reproducibility (the same model with the same seed will produce the same results) in all cases. I would recommend that everyone on version 4.2.x should upgrade to this version; version 4.2 SHOULD NOT BE USED. 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.
IMPORTANT BUG FIXES:
-
A bug that caused SLiMgui to crash when typing in callbacks, such as
mutationEffect()etc., has been fixed. Unfortunately we don't have a good solution for unit-testing SLiMgui, so bugs like this can creep in. -
The other important bug fix, relative to 4.2, was in 4.2.1; see those release notes for details.
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 .
-
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 use conda or 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.2 release.
The manuals, recipes, and reference sheets have undergone only version number tweaks, if that, and do not need to be downloaded again if you downloaded them for version 4.2.
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.2.x. 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
Version 4.2.1
Hi folks! SLiM 4.2.1 has just been released. This is a bug fix release. It should preserve backward compatibility with SLiM 4.2 in all cases (models that run in 4.2 will continue to run with no changes). Similarly, it preserves backward reproducibility (the same model with the same seed will produce the same results) in all cases. I would recommend that everyone on version 4.2 should upgrade to this version; it has one very important bug fix, and version 4.2 SHOULD NOT BE USED. See the new SLiM manual (chapter 30) and the VERSIONS file for a complete list of changes, which will be summarized here.
[ Note that on 30 April 2024 this release was patched to fix a crash in SLiMgui. Only SLiMgui was affected by this bug, so users of the command-line slim program do not need to update that. Users of SLiMgui should reinstall 4.2.1 once the installer for their platform has been updated. Sorry for the confusion! ]
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.
IMPORTANT BUG FIXES:
- A bug that could result in a crash or a corrupted run (producing incorrect results) has been fixed. This bug would bite under very specific circumstances: in a nonWF model, with a subpopulation of size 0 (containing no individuals), if and only if a non-zero-size subpopulation had not existed in a previous tick. This usage pattern is somewhat common, so this was a very dangerous bug that unfortunately merited a new release.
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 use conda or 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.1 release.
The manuals, recipes, and reference sheets have undergone only version number tweaks, if that, and do not need to be downloaded again if you downloaded them for version 4.2.
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.2 (and 4.2.1). 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
Version 4.2
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
Plotclass (which exists only when running in SLiMgui). This is similar tobaseplotting 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 newlogFileData()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 userescheduleScriptBlock()to dynamically schedule events and callbacks is now largely a thing of the past! So legal event declarations would includeN:(N+M+2) early(),seq(1, 100, by=5) early(), andc(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
forloops now support multipleinclauses, so a loop likefor (x in 1:3, y in 2:4) { ... }is now legal. Allinclauses 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 newforloop 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
floatare no longer legal for subsetting a vector with operator[]. The ability to subset withfloatindices was inherited from R, and seems unwise. Existing code that usesfloatindices will need to convert tointegerwithasInteger(), perhaps after callinground(). -
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 ofappend=Tandcompress=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
Version 4.1
Hi all! SLiM 4.1 has just been released. This is a major point release with a bunch of new stuff. It should preserve backward compatibility with SLiM 4.0 and 4.0.1 (models that run in those will continue to run). Backward reproducibility will usually, but not always, be preserved (the same model with the same seed might produce different results, due to algorithmic changes under the hood). I would recommend that everyone should upgrade to this version; the 4.0 series has proved to be stable. 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.2.0, 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:
-
Spatial maps, used to represent spatially-varying values in continuous-space models, have been split out from Subpopulation into their own Eidos class, SpatialMap. This has allowed the addition of many new features, including doing high-quality bicubic interpolation of map values, algebraically blending and manipulating maps, smoothing/blurring map values, and using spatial maps to influence directed dispersal and habitat preference. This opens up lots of exciting new possibilities for spatial modeling.
-
InteractionType has a new method, setConstraints(), that lets you set constraints on which receivers and/or exerters are eligible to interact, allowing you to make spatial (or non-spatial) interactions that influence only a subset of a population. Constraints can include age, sex, migrant status, and various tag values, making this mechanism quite flexible. For example, a mate-search interaction might involve only female receivers of a given age range, and only male exerters of a perhaps different age range, and might require males to have a certain tag value to be considered eligible.
-
A new pointDeviated() method can manage kernel-based dispersal and boundary condition enforcement in a single vectorized call, making dispersal/movement in spatial models much simpler and more efficient.
-
Individuals now have a set of new logical tag properties, tagL0/tagL1/tagL2/tagL3/tagL4, that can be used in your script to track binary/logical state for your individuals, for whatever purpose you need.
-
Profiling of line-by-line model performance can now be done at the command line (not just in SLiMgui), allowinf you to profile your model on the platform where it will be run (i.e., on your computing cluster) for greater accuracy. A custom build of slim from sources is required, but very easy to make.
-
The Dictionary class now allows integer keys, not just string keys, making it possible to use Dictionary as a sort of "sparse array " or "ragged array" class. Also, both Dictionary and DataFrame now allow objects of all classes to be added as values (with some caveats).
-
For nonWF models, the various reproduction methods such as addCrossed() now have an optional count parameter, allowing you to generate a whole litter of offspring with a single call. The addRecombinant() method gets a couple of additional extensions: parent1/parent2 parameters to supply pedigree tracking information, and a randomizeStrands parameter to request that the initial copy strand for each gamete should be chosen randomly from the genomes supplied for that gamete.
These are only the most notable new features; see the full release notes in the SLiM manual for more.
IMPORTANT BUG FIXES:
-
In multispecies models (and only in multispecies models), the mutationCounts() / mutationFrequencies() methods could return zero in some cases, due to a caching bug.
-
Many memory leaks have been tracked down and fixed. These were mostly minor, but a couple were larger, so some models might see a large improvement in memory usage.
NEW/REVISED RECIPES:
Note that chapters 15 and 16 switched places in the manual, so all recipe numbers in those chapters have changed! Recipe revisions were extensive for this release, with changes to show off many of the new features that were added; see the release notes in the manual for details. A couple of new recipes are worth calling out here. For the new spatial-modeling features in SLiM 4.1, section 16.3 got a new sub-recipe (16.3 V) and sections 16.14 and 16.18 are completely new. Also, for those interested in modeling strictly biallelic loci, there is a new section, 14.16, showing a third possible approach (in addition to the two approaches already shown in section 14.15).
INSTALLATION NOTES:
-
If you are on Fedora, RedHat, CentOS, Arch, 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.
-
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.
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.1 will happen, but the changes will be minor. It is offered occasionally in person, but the four scheduled dates (all in Europe in 2024) are full and wait-listed.
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
Version 4.0.1
Hi everybody! SLiM 4.0.1 has just been released. This is a minor release, mostly to fix a couple of bugs. It should preserve backward compatibility and reproducibility from SLiM 4.0. If you are on SLiM 4.0 now, upgrading is strongly recommended; if you have chosen to stay back on SLiM 3 for the time being, you can continue to do so if you wish (or if you decide to move to SLiM 4 now, please also read the release notes for SLiM 4.0 for important information). Recommended python package versions are the same as for SLiM 4.0: at least 0.5.2 for tskit, 1.2.0 for msprime, and 1.0 for pyslim. See the SLiM manual (chapter 29) and the VERSIONS file for a complete list of changes, which will be summarized here.
NEW FEATURES:
-
Individual has a new property, meanParentAge, that makes calculating the generation time of nonWF models easier. This is useful for adjusting time units when using tree-sequence recording; see the pyslim documentation at https://tskit.dev/pyslim/docs/latest/time_units.html for more information. (It should be updated to show the use of meanParentAge shortly.)
-
DataFrame has a new method, asMatrix(), that converts the target DataFrame into a matrix. This makes it easy to read a matrix from disk: use readCSV() to read the file in as a DataFrame, and then use asMatrix(). Recipe 16.12 II now provides an example of that.
-
DataFrame's subset() method now takes NULL for row/col to get whole rows/columns
-
readCSV() now accepts sep="" to use a "whitespace" separator (as in R).
IMPORTANT BUG FIXES:
- Models using tree-sequence recording that read in a saved tree sequence with readFromPopulationFile() could raise an error or leak a large amount of memory; see https://groups.google.com/g/slim-discuss/c/ys4zAQLlXsY/m/VTWbBtO9AAAJ.
NEW/REVISED RECIPES: Recipe 6.1.2 (reading a recombination rate map from a file) now uses readCSV() to read the rate map.
INSTALLATION NOTES:
-
If you are on Fedora, RedHat, CentOS, Arch, or the newly supported platforms openSUSE and SUSE Linux Enterprise, the SLiM installer for your Linux platform has already been updated (see chapter 2 of the SLiM manual for details).
-
If you are on Debian or Ubuntu, the installation strategy is being overhauled; we will announce when an installer for those platforms is available, but it may take a while (the installation instructions in the manual for those platforms will either not work, or give you version 3.7.1, I imagine); in the meantime Debian and Ubuntu users will need to build from sources, sorry (see chapter 2 for instructions).
-
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.
-
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.
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 not yet been updated to SLiM 4; that should happen fairly soon.
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
Version 4.0
SLiM 4.0 has just been released. This is a major release, and breaks backward compatibility and reproducibility for many models. Given the magnitude of changes, some users may want to continue living on SLiM 3.7.1 for the time being; it is a stable release. However, a handful of bugs in 3.7.1 have been fixed in SLiM 4, as discussed below; in general, upgrading is thus recommended. This announcement will only touch on the highlights of what's new in SLiM 4; see the SLiM manual (chapter 29) for a more complete list, or the VERSIONS file for even more detail.
GENERAL OBSERVATIONS:
-
To use SLiM 4 with tree-sequence recording, you should update to the current versions of related Python packages; recommended versions are at least 0.5.2 for tskit, 1.2.0 for msprime, and 1.0 for pyslim. Version 1.0 of pyslim has just been released moments ago; huzzah! There have been some changes to pyslim; for a guide to upgrading your Python code from previous versions, see https://tskit.dev/pyslim/docs/stable/previous_versions.html.
-
SLiM's Eidos interfaces – the names of properties, methods, and classes – have changed significantly in 4.0. If you open and run your scripts in the new SLiMgui, it should offer to "autofix" most of these changes for you, updating your scripts to 4.0. Notably: in preparation for planned future work, fitness() callbacks are now called mutationEffect() callbacks, and fitness(NULL) callbacks are now called fitnessEffect() callbacks. Along the same lines, early() is no longer the default event type; now there is no default, and early() must be explicitly declared in your script. SLiMgui should autofix both of these changes for you. For changes that are not autofixed, please see the manual for further information.
-
Note that the macOS double-click installer no longer installs the manuals for you (matching the installers on other platforms). The manuals should now be downloaded separately from http://messerlab.org/slim/.
MAJOR NEW FEATURES:
-
The blockbuster new feature is that SLiM 4 supports simulating multiple species. Each species can have its own genetic architecture, its own behaviors and life history, and can live on its own timescale. You can easily simulate ecological interactions like predation, parasitism, mutualism, and competition, with either an individual-based or an aggregated approach. In the SLiM manual, a new section 1.9 summarizes the concepts involved in multispecies modeling, and a new chapter 19 provides an in-depth look with eight new recipes; see those for further details on this exciting advance, which makes it easy to model eco-evolutionary and coevolutionary dynamics in SLiM. Single-species models work much as they did before; this change is (almost) transparent for them.
-
InteractionType has undergone a complete redesign under the hood to support spatial interactions between individuals of different species. Most of these changes are transparent to the end user, although a few minor interface changes were made, and a few new methods were added; see chapter 29 for further details. The big user-visible change is that for many models the memory usage due to InteractionType, which could be quite large for large models with a large maximum interaction distance, will be substantially reduced.
-
A new killIndividuals() method allows nonWF models to simulate mortality at (almost) any time, such as when a predator eats a prey, or when a diease kills its host, without having to use fitnessScaling for this purpose. Several recipes now illustrate the use this method and discuss its applications.
-
A simulated species can now be a "no-genetics" species, with no chromosome and no mutations at all. This avoids some annoying boilerplate genetics initialization, and slightly increases efficiency, when a species is only present for its ecological effects and does not evolve.
-
To reduce order-dependency issues with callbacks, the order in which individuals are handled by callbacks can now be randomized. This order randomization is enabled by default, but can be turned off with initializeSLiMOptions().
There are lots of more minor new features; see chapter 29 for a more complete list.
IMPORTANT BUG FIXES:
-
Mutation frequencies/counts provided by the mutationFrequency() and mutationCount() methods could be incorrect in certain situations, expected to be rare; see https://groups.google.com/g/slim-discuss/c/ADkbalv6vcw for discussion.
-
Tree-sequence metadata could be malformed in certain conditions after removal of a subpopulation.
-
A crash could occur in removeMutations() if it was called on a null genome.
-
Not exactly a "bug", but: calcFST() gave an "average of ratios"; it now gives a "ratio of averages", following best practice.
NEW/REVISED RECIPES: Many, perhaps most, of the recipes in the SLiM manual have been revised for this release, to bring them forward to SLiM 4's Eidos interfaces; most of these changes are trivial and were simply "autofixed" by SLiMgui. A few recipes have also had bug fixes or improvements made, notably 18.14 and 18.15 (uniquing down mutations). There are some new recipes: besides the new multispecies recipes in chapter 19, we now have recipe 14.15 (showing how to make a truly biallelic model in SLiM, primarily of interest for matching SLiM to biallelic analytical models), and a new second part to recipe 16.19 showing a second way to do a nonWF range expansion model (using a survival() callback). If your own models are based upon SLiM recipes, it is strongly suggested that you check for changes in those recipes so that you benefit from the latest improvements and fixes.
INSTALLATION NOTES: If you are on Fedora, RedHat, CentOS, Arch, or the newly supported platforms openSUSE and SUSE Linux Enterprise, the SLiM installer for your Linux platform has already been updated (see chapter 2 of the SLiM manual for details). If you are on Debian or Ubuntu, the installation strategy is being overhauled; we will announce when an installer for those platforms is available, but it may take a while (the installation instructions in the manual for those platforms will either not work, or give you version 3.7.1, I imagine); in the meantime Debian and Ubuntu users will need to build from sources, sorry (see chapter 2 for instructions). 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 (perhaps two weeks, at a guess); a followup post will be made here when it is ready, and in the meantime you can 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. The manuals, recipes, and reference sheets have also undergone revisions, so you should re-download those too. As noted at top, you must update to the latest pyslim, tskit, and msprime if you are using tree-sequence recording.
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 not yet been updated to SLiM 4; that should happen fairly soon.
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
Version 3.7.1
SLiM 3.7.1 has just been released. This is a "patch release" containing only bug fixes. It is recommended for all users presently on SLiM 3.7, since it eliminates a couple of very visible bugs, including one common crash. It preserves backward compatibility and backward reproducibility with SLiM 3.7, except in cases where the bugs that were fixed might have caused incorrect results to be produced. No update to msprime, tskit, or pyslim is necessary with this new version.
IMPORTANT BUG FIXES:
-
Fixed a semi-reproducible crash when treeSeqOutput() is called. In cases where the crash did not occur, it is possible that data corruption occurred and output is incorrect. Users who used tree-sequence recording in SLiM 3.7 should therefore re-run their models just to be safe. This bug did not exist in previous SLiM versions.
-
Fixed a spurious self-test error that happened occasionally. The test itself was wrong; there was no problem with the code being tested.
-
Fixed a spurious error like "subpopulation p0 has already been used" that would happen in certain circumstances even though the subpopulation had not already been used.
-
Fixed a problem with the appearance of profile output in SLiMgui when in dark mode that made it unreadable.
NEW/REVISED RECIPES: Recipes 17.8 and 17.9 were updated to use sim_ancestry() instead of simulate(), to show current best practices with msprime. Recipe 18.13 was fixed to work with new pyslim changes.
INSTALLATION NOTES (see chapter 2 of the SLiM manual for details): Installers for macOS, Linux, and conda (for macOS, Linux, and Windows) are online now. The Windows pacman installer is not yet ready; a separate post will be made to slim-discuss when that installer has been updated.
SLIM BEGINNERS: If you're a beginner in SLiM, you might want to check out our recent paper "Evolutionary modeling in SLiM 3 for beginners" (http://dx.doi.org/10.1093/molbev/msy237). Beyond that, a complete SLiM Workshop is available online at http://benhaller.com/workshops/workshops.html, and is highly recommended for new users.
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