SLiM 3.5 released

287 views
Skip to first unread message

Ben Haller

unread,
Dec 8, 2020, 2:02:33 AM12/8/20
to slim-discuss
We have just released SLiM 3.5.  This is a major release, probably the biggest since 3.0.  It breaks backward compatibility/reproducibility in several ways, to allow forward progress, but the changes needed to your scripts, if any, will be extremely minimal.  Please read the following abbreviated release notes carefully; complete release notes are in the manual, chapter 29.

SLiM now provides installers for conda, for Linux platforms based on Fedora (including CentOS and RedHat Enterprise), and for the Linux platform Arch, in addition to the macOS installer.  Instructions for using all of these installers are provided in chapter 2 of the manual.  An installer for Debian-based platforms, including Ubuntu, does not yet exist as that is apparently more complex; if you know how to do that, please contribute to GitHub issue #121.  Thanks to Bryce Carson, Graham Gower, Jerome Kelleher, and Ian Caldas for help with the various installers.

In this release, the new cross-platform SLiMgui app based on the Qt framework is fully public, and is named SLiMgui on all platforms; it runs on macOS, Linux, and Windows under the WSL (thanks to Bernard Kim for figuring out the latter).  The old Cocoa-based SLiMgui app is now called SLiMguiLegacy, and is not included in the macOS installer; if you need to use it you can build it in Xcode on macOS, but it is no longer supported.  The macOS builds of the slim and eidos command-line tools in the installer are now Universal, i.e., are native on the new Apple Silicon machines as well as on Intel machines (but SLiMgui is not, since Qt has not yet been ported).

New Eidos features: tabulate() and quantile() functions similar to R; a colors() function for various color palettes; paste() / paste0() now take multiple arguments to avoid the evil paste(c(...)) pattern, but this breaks backward compatibility since sep= must now be specified as a named argument, like paste(a, b, c, sep=" "); a new Image class can read PNG images for easy spatial map creation; a new Dictionary class encapsulates SLiM's setValue()/getValue() semantics into a standalone object class (from which SLiM classes inherit to get their dictionary-like behavior); defineGlobal() allows global variables to be defined; match() is dramatically faster for large vectors; sample() is much faster for shuffles and large N, but this breaks backward reproducibility for models using sample().

New SLiM features: mutation() callbacks can now return an existing mutation for easy uniquing of mutations; a SLiMSim subsetMutations() method for fast lookup of mutations by criteria; tskit 0.3.0 integration featuring faster simplification, retention of individuals referenced by retained nodes; defineSpatialMap() now requires a matrix, and gridSize is removed, and matrices are interpreted differently (better) to match the new Image class, but all this breaks backward compatibility if you are using spatial maps; you can now keep long-term references to some SLiM classes (Chromosome & Mutation) with defineConstant(), defineGlobal(), or setValue(), and new recipes 9.9 and 9.10 show the utility of this; new LogFile class makes writing out CSV/TSV log files easy, as new recipe 4.2.5 demonstrates; pop-gen summary statistics functions calcFST(), calcVA(), calcHeterozygosity(), calcPairHeterozygosity(), calcWattersonsTheta() added; Genome methods mutationCountsInGenomes() and mutationFrequenciesInGenomes() added for easy calculation of counts/frequencies within any sample of genomes; reproductive output tracking now included when "pedigree tracking" is enabled, with new reproductiveOutput (Individual) and lifetimeReproductiveOutput (Subpopulation) properties; codonsToAminoAcids() can now return integer amino acid codes; outputFull() can now save pedigree IDs, and readFromPopulationFile can read them.

New SLiMgui features: new plots for 1D/2D SFS, 2D frequency spectrum, age distribution, population/subpop fitness distributions, population size ~ time; optional (in prefs) line numbers, current line highlighting; Jump pop-up button for quick navigation of large models; full script relayout by holding down alt/option when you click the pretty print button; automatic tree-seq simplification is now a separate category in SLiMgui profiles; optional autosave on recycle (off by default, in prefs); the Step button can now be held down to step repeatedly.

Policy changes that might break existing models: mutations can no longer be added to individuals of age > 0, to prevent internal inconsistencies; when generating gametes, mutation positions are now uniqued so you never get two new mutations at the same position in the same gamete, but this breaks backward reproducibility for almost all models; the originGeneration property of Mutation can no longer be used by models as scratch space, it must be the actual generation of origin; problems encountered during writeFile() are now errors, not warnings.

Major bug fix: the treatment of NAN values (not-a-number floating point values) in Eidos functions and comparison operators has been normalized and debugged to comply with IEEE rules and better match R's behavior.  There are a great many changes in behavior as a result, and these break backward compatibility.  If your model relied upon the behavior of NANs in Eidos you should re-validate it.  Models that do not encounter NANs should be unchanged.

Major bug fix: the precedence of operator ^ has been fixed to be higher than that of unary minus, following standard mathematical convention so that -2^2 is evaluated as (-2)^2 rather than -(2^2).  If your model relied upon the incorrect operator precedence, this breaks backward compatibility.

New recipes (besides those mentioned above): 18.4 demonstrates mutation uniquing for identity-by-state instead of identity-by-descent; 10.6 II demonstrates a second technique for varying dominance coefficients; 16.19 demonstrates range expansion into empty subpopulations in a stepping-stone model; 16.20 demonstrates logistic population growth with the Beverton-Holt model.

Revised recipes (see release notes): 5.4 (an extensive revamp of the Gravel model recipe by Chase Nelson), 13.5, 14.7, 14.8, 15.10, 15.11, 17.2, 17.4, 17.5, 17.7, 17.9, 18.13.

These notes are not comprehensive (see the manual and the GitHub history for more detail), but they provide the highlights.  This release is recommended for all users; however, since it does break backward compatibility/reproducibility in several ways, use caution when upgrading.  Look at your output files for new warnings from SLiM; re-run all runs from scratch since the results from a given random number seed may change; re-validate your model's behavior in whatever way you previously did.

You can obtain SLiM 3.5 from the SLiM home page at http://messerlab.org/slim/; note that the manuals, recipes, and reference sheets have also undergone revisions.

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

Peter Ralph

unread,
Dec 8, 2020, 3:22:00 PM12/8/20
to Ben Haller, slim-discuss
p.s. To go along with this, I've released a new version of pyslim, so
if you're working with the tree sequences that SLiM can produce, you
should update pyslim as well. (if not, you can stop reading =)

The main update to pyslim is that metadata handling is now down by
tskit directly, and so is a lot nicer. Doing this required some
changes: notably, metadata objects are now dictionaries. Previous code
will still work, but with a deprecation warning, and an explanation of
how to update your code. There's some other smaller changes: see
https://github.com/tskit-dev/pyslim/blob/main/CHANGELOG.rst .

As always, if you have any issues, please let me know, either here (if
it's a "how do I use this" question) or as a github issue (if it's a
"I think this is wrong" issue).

Happy slimulating,
Peter

Lucas Marie-Orleach

unread,
Jan 12, 2021, 9:26:40 AM1/12/21
to slim-discuss
Hi,
On my end, the Source() function no longer works on SLiM 3.5 (which I believe is due to the changes in the paste() function).
It can be fixed by using 'executeLambda(paste(readFile("File Path"), sep="\n"));' instead.
Cheers,

Lucas

Ben Haller

unread,
Jan 12, 2021, 12:42:29 PM1/12/21
to slim-discuss
Hi!  Yep, this bug is known and fixed in the GitHub head, and will roll in a SLiM 3.5.1 update some time fairly soon.  The fix you cite should work.  Thanks for the report!

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University

bcar...@mtroyal.ca

unread,
Jan 14, 2021, 6:44:45 PM1/14/21
to slim-discuss
The Fedora, CentOS, and RHEL packages have been rebuilt to correct a desktop integration issue on Fedora Workstation (Gnome).

The new package version is SLiM-3.5-4.

CentOS (and assumedly RHEL) do not need to update, as the application icon and application name in the Gnome Application Menu and Dash are not incorrect.

Fedora users are recommended to update their package to the new release to have proper desktop integration of SLiMgui in Gnome.

To view the changelog, inspect the package changelog with:
`dnf changelog SLiM-3.5-4.fc33`

bcar...@mtroyal.ca

unread,
Jan 31, 2021, 4:24:42 AM1/31/21
to slim-discuss
The Fedora, CentOS, and RHEL packages have been rebuilt; the new package version is SLiM-3.5-6.

Upgrading will cause you to lose your SLiMgui preferences (such as font size, syntax highlighting, and recently used files), however all users of the package are recommended to upgrade to the newest build.

This is considered the final build of the package, as no issues have been identified or reported that have not been been corrected (as of this build of the package).


To view the changelog, inspect the package changelog with:
`dnf changelog SLiM` or `dnf changelog SLiM-3.5-6.fc33`.

Reply all
Reply to author
Forward
0 new messages