1.2.0b1 - 2026-09-26
This is a beta release for the upcoming 1.2.0,
to support the beta release of SLiM v6.
Major update release to support the release of SLiM v6.0. The main update to
SLiM is support for traits, which accompanied a number of changes to metadata,
particularly mutation metadata. For more information see
https://tskit.dev/pyslim/docs/latest/previous_versions.html
Breaking changes:
-
The release of SLiM 6.0, changes to metadata (see below) mean that accessing
top-level metadata (e.g.,ts.metadata["SLiM"]) more than a few times in
a script will take a long time. Scripts that previously ran quickly may take a
prohibitively long. See the documentation for simple changes that fix the problem:
https://tskit.dev/pyslim/docs/latest/previous_versions.html -
The SLiM tree sequence file version number has changed to 1.0. Use
pyslim.update
to convert your tree sequence file to this format. -
Metadata for SLiM's mutations are no longer stored along with the tskit mutations,
because mutation stacking allows each tskit mutation to be associated with more
than one SLiM mutation. Now, metadata for each unique mutation is stored in
top-level metadata, underts.metadata["SLiM_mutation_list"]. The recommended
way to access this information is by obtaining the SLiM ID-to-metadata dict
returned bypyslim.mutation_metadata(ts). -
The SLiM mutation IDs represented by each tskit mutation should no longer be
read in from thederived_stateproperty, but instead from the tskit mutation's
metadata. (However, SLiM still writes these out in text to thederived_state
entry as before.) -
Previously,
msprime.sim_mutationswith themsprime.SLiMMutationModel
would record SLiM metadata along with each new mutation. However, msprime
does not modify top-level metadata, and so the methodadd_mutation_metadata
should be used after adding SLiM mutations. -
This is a SLiM change, but top-level metadata is now encoded using the
json+struct
codec now provided by tskit (so that the mutation metadata is not too large/slow). -
The top-level and individual metadata schemas now depend on the number of traits
in the model. The methodsslim_tree_sequence_metadata_schemaand
slim_individual_metadata_schemacan be used to produce correct schema. -
Individual metadata no longer has a
flagscomponent; the one flag we did set here
(pyslim.INDIVIDUAL_FLAG_MIGRATED) is now recorded, aspyslim.INDIVIDUAL_MIGRATED,
inindividual.flags(rather thanindividual.metadata['flags']). -
The default sex ratio for populations is now 0.5 instead of 0.0.
(:issue:339, :user:petrelharp)
Bug fixes:
-
pyslim.annotatenow has anum_chromosomesargument. Previously it could not be
easily used to annotate multichromosome simulations with more than 8 chromosomes.
(It also now has anum_traitsargument.) -
In some previous versions, converting files produced by a yet-older version of SLiM
to the previously-current file version dropped some information from metadata:
nucleotide values for mutations, and pedigree parent IDs for individuals. This only
may have affected users usingpyslim.convert(ts)in a previous version of pyslim
on a tree sequencetswith SLiM file version prior to 0.9. -
Since verison 1.1, the value of
pyslim.INDIVIDUAL_FLAG_MIGRATEDhas been 2,
when in fact it should have been 1, so code using this flag to detect
migrants would have been wrong (and should have found no migrants, ever).
(Also, this flag is now deprecated; see above.)
New features:
-
SLiM now includes in metadata information about the effects of mutations on
quantitative traits, the values of traits for individuals, and the values of
various "tags" defined in SLiM. -
default_slim_metadatacan now take additional arguments to modify the returned
values.