Skip to content

beta release for SLiM v6

Latest

Choose a tag to compare

@petrelharp petrelharp released this 26 Sep 19:55
· 1 commit to main since this release

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, under ts.metadata["SLiM_mutation_list"]. The recommended
    way to access this information is by obtaining the SLiM ID-to-metadata dict
    returned by pyslim.mutation_metadata(ts).

  • The SLiM mutation IDs represented by each tskit mutation should no longer be
    read in from the derived_state property, but instead from the tskit mutation's
    metadata. (However, SLiM still writes these out in text to the derived_state
    entry as before.)

  • Previously, msprime.sim_mutations with the msprime.SLiMMutationModel
    would record SLiM metadata along with each new mutation. However, msprime
    does not modify top-level metadata, and so the method add_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 methods slim_tree_sequence_metadata_schema and
    slim_individual_metadata_schema can be used to produce correct schema.

  • Individual metadata no longer has a flags component; the one flag we did set here
    (pyslim.INDIVIDUAL_FLAG_MIGRATED) is now recorded, as pyslim.INDIVIDUAL_MIGRATED,
    in individual.flags (rather than individual.metadata['flags']).

  • The default sex ratio for populations is now 0.5 instead of 0.0.
    (:issue:339, :user:petrelharp)

Bug fixes:

  • pyslim.annotate now has a num_chromosomes argument. Previously it could not be
    easily used to annotate multichromosome simulations with more than 8 chromosomes.
    (It also now has a num_traits argument.)

  • 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 using pyslim.convert(ts) in a previous version of pyslim
    on a tree sequence ts with SLiM file version prior to 0.9.

  • Since verison 1.1, the value of pyslim.INDIVIDUAL_FLAG_MIGRATED has 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_metadata can now take additional arguments to modify the returned
    values.