Skip to content

Releases

Maintenance and minor feature release

Choose a tag to compare

@jeromekelleher jeromekelleher released this 30 Oct 16:42

Maintenance

  • Add support and wheels for Python 3.15
  • Require Python >= 3.12

Features

  • CLI commands that load a tree sequence now read from stdin when the input path argument is omitted.
  • The returned object from variant.counts() and variant.frequencies() now stores alleles in the order defined in variant.alleles.
  • If top-level metadata is large, then repeatedly accessing it can be costly, so now it throws a warning if the metadata is more than 200Kb and it is accessed more than 20 times alerting the user to this possibility (both constants are modifiable, however).
  • TreeSequences and TableCollections now have a metadata_size property, returning their size in bytes.

Bugfixes

  • Update to kastore C version 2.1.3 to include file security fix
  • TableCollection.delete_older now checks table integrity first, raising an error for invalid node or mutation references instead of reading out of bounds

Python 1.0.3

Choose a tag to compare

@petrelharp petrelharp released this 14 May 18:09

Maintenance and minor feature release.

Features

Bugfixes

  • Fix a Y-axis positioning bug in draw_svg when a title was provided. (@hyanwong, #3451, #3452)

Python 1.0.2

Choose a tag to compare

@jeromekelleher jeromekelleher released this 06 Mar 12:53

Maintenance release.

  • Require Python >= 3.11

C 1.3.1

Choose a tag to compare

@github-actions github-actions released this 06 Mar 12:25

Maintenance release.

  • Update to kastore 2.1.2
  • Fix doc typo for file uuid (#3399)
  • Migrate linting to clang-format 21.1.8 (#3389)
  • Support compile time setting of debug stream (#3364)

Python 1.0.1

Choose a tag to compare

@jeromekelleher jeromekelleher released this 06 Feb 11:26

Maintenance release.

Bugfixes

  • ts.samples(population=...) now raises a ValueError if the population
    ID is e.g. a population name, rather than silently returning no samples.
    (@hyanwong, #3344)

Maintenance

  • Add support for Python 3.14

Python 1.0.0

Choose a tag to compare

@github-actions github-actions released this 27 Nov 14:27
f1b139e

🎉 Version 1 is here!!! 🥳

tskit development doesn't end here, but this marks the point at which:

Breaking changes will not be made except where it is unavoidable to correct incorrect behaviour or where they are forced by external factors such as dependencies

Full credit for this release and for tskit generally goes to the wonderful community of contributors, who you can see here: https://tskit.dev/software/tskit.html

Full changelog:

Breaking changes

  • The reference_sequence argument to TreeSequence.alignments is now
    required to be the same length as the tree sequence. Previously it was
    required to be the length of the requested interval.
    (@benjeffery, #3317)

  • TreeSequence.tables now returns a zero-copy immutable view of the tables.
    To get a mutable copy, use TreeSequence.dump_tables().
    (@benjeffery, #3288, #760)

  • For a tree sequence to be valid, the mutation parents in the table collection
    must be correct and consistent with the topology of the tree at each mutation site.
    TableCollection.tree_sequence() will raise a _tskit.LibraryError if this
    is not the case.
    (@benjeffery, #2729, #2732, #3212).

  • Drop Python 3.9 support and require Python >= 3.10.
    (#3267, @benjeffery)

  • ltrim, rtrim, trim and shift raise an error if they are
    used on a tree sequence containing a reference sequence.
    (@hyanwong, #3210, #2091)

Features

  • Add tskit.jit.numba.jitwrap and NumbaTreeSequence to allow simplified
    use and development of Numba-jitted functions with tree sequences. See the
    documentation <https://tskit.dev/tskit/docs/stable/numba.html>_ for details.
    (@andrewkern, #3295, #3294)

  • TreeSequence.map_to_vcf_model now also returns the transformed positions and
    contig length. (@benjeffery, #3174, #3173)

  • draw_svg() methods now associate tree branches with edge IDs.
    (@hyanwong, #3193, #557)

  • draw_svg() methods now allow the y-axis to be placed on the right-hand side
    using y_axis="right". (@hyanwong, #3201)

  • Add contig_id and isolated_as_missing to VcfModelMapping
    (@benjeffery, #3219, #3177).

  • Add TreeSequence.mutations_edge, which returns the edge ID for each mutation's
    edge. (@benjeffery, #3226, #3189)

  • Add TreeSequence.sites_ancestral_state, TreeSequence.mutations_derived_state and
    TreeSequence.mutations_inherited_state properties to return the ancestral state of sites,
    the derived state of mutations and the inherited state of mutations as NumPy arrays of
    the new NumPy 2.0 StringDType.
    (@benjeffery, #3228, #2632, #3276, #2631)

  • Tskit now requires NumPy version 2 or later. However, you can still use
    tskit with NumPy 1.x by building tskit from source with NumPy 1.x using
    pip install tskit --no-binary tskit. With NumPy 1.x, any use of the new
    StringDType properties will result in a RuntimeError. If you try to
    use another Python module that was compiled against NumPy 1.x with NumPy 2.x
    you may see the error "A module that was compiled using NumPy 1.x cannot be
    run in NumPy 2.0.0 as it may crash.". If no newer version of the module is
    available you will have to use the NumPy 1.x build as above.

  • Add Mutation.inherited_state property which returns the inherited state
    for a single mutation. (@benjeffery, #3277, #2631)

  • Add all_mutations and all_edges options to TreeSequence.union,
    allowing greater flexibility in "disjoint union" situations.
    (@hyanwong, @petrelharp, #3181)

  • Add TreeSequence.divergence_matrix, which was previously undocumented.

  • TreeSequence.variants, .genotype_matrix, .haplotypes, and .alignments methods
    now fully support isolated_as_missing behaviour with internal nodes. .alignments is
    also around 10% faster.
    (@benjeffery, #3313, #3317, #1896)

Bugfixes

  • In some tables with mutations out-of-order TableCollection.sort did not re-order
    the mutations so they formed a valid TreeSequence. TableCollection.sort and
    TableCollection.canonicalise now sort mutations by site, then time (if known),
    then the mutation's node's time, then number of descendant mutations
    (ensuring that parent mutations occur before children), then node, then
    their original order in the tables. (@benjeffery, #3257, #3253)

  • Fix bug in TreeSequence.genetic_relatedness_vector that previously ignored
    span_normalise: previously, span_normalise was always set to False;
    now the default is True in agreement with other statistics, so the returned
    values will change. (@petrelharp, #3300, #3241)

  • Fix bug in TreeSequence.pair_coalescence_counts when span_normalise=True
    and a window breakpoint falls within an internal missing interval.
    (@nspope, #3176, #3175)

  • Fix metadata schemas that are equal but have different byte representations not
    being considered equal when using TableCollection.assert_equals and
    Table.assert_equals.
    (@benjeffery, #3246, #3244)

  • k-way statistics no longer require k sample sets, allowing in particular
    "self" comparisons for TreeSequence.genetic_relatedness. This changes the
    error code returned in some situations.
    (@andrewkern, @petrelharp, #3235, #3055)

  • Fix UnboundLocalError in draw_svg() when using numeric max_time
    values with mutations over roots.
    (@benjeffery, #3274, #3273)

  • Prevent iterating over a TopologyCounter.
    (@benjeffery, #3202, #1462)

  • Fix TreeSequence.concatenate() to work with internal samples by using the
    all_mutations and all_edges parameters in union().
    (@hyanwong, #3283, #3181)

C API C_1.3.0

Choose a tag to compare

@github-actions github-actions released this 26 Jan 16:38
f1b139e

Breaking changes

  • trees.c now depends on genotypes.c (via tskit/genotypes.h) and must
    be built and linked together with it.
    (@benjeffery, #3324)

Features

  • tsk_variant_init and associated variant decoding methods now
    fully support TSK_ISOLATED_NOT_MISSING not being set for internal nodes.
    (@benjeffery, #3313)

  • Add tsk_treeseq_decode_alignments to decode full-length reference-based
    sequence alignments for specified nodes over a genomic interval, respecting
    TSK_ISOLATED_NOT_MISSING semantics.
    (@benjeffery, #3324, #3319)

Python 1.0.0b3

Choose a tag to compare

@github-actions github-actions released this 15 Oct 12:27

Breaking Changes

  • TreeSequence.tables now returns a zero-copy immutable view of the tables.
    To get a mutable copy, use TreeSequence.dump_tables().
    (@benjeffery, #3288, #760)

  • For a tree seqeunce to be valid mutation parents in the table collection
    must be correct and consistent with the topology of the tree at each mutation site.
    TableCollection.tree_sequence() will raise a _tskit.LibraryError if this
    is not the case.
    (@benjeffery, #2729, #2732, #3212).

  • Drop Python 3.9 support, require Python >= 3.10 (#3267, @benjeffery)

Features

  • TreeSequence.map_to_vcf_model now also returns the transformed positions and
    contig length. (@benjeffery, #3174, #3173)

  • draw_svg() methods now associate tree branches with edge IDs
    (@hyanwong, #3193, #557)

  • draw_svg() methods now allow the y-axis to be placed on the right-hand side
    using y_axis="right" (@hyanwong, #3201)

  • Add contig_id and isolated_as_missing to VcfModelMapping
    (@benjeffery, #3219, #3177)

  • Add TreeSequence.mutations_edge which returns the edge ID for each mutation's
    edge. (@benjeffery, #3226, #3189)

  • Add TreeSequence.sites_ancestral_state, TreeSequence.mutations_derived_state and
    TreeSequence.mutations_inherited_state properties to return the ancestral state of sites,
    derived state of mutations and inherited state of mutations as NumPy arrays of
    the new numpy 2.0 StringDType.
    (@benjeffery, #3228, #2632, #3276, #2631)

  • Tskit now distributes with a requirement of numpy version 2 or greater. However, you can still use
    tskit with numpy 1.X by building tskit from source with numpy 1.X using pip install tskit --no-binary tskit.
    With numpy 1.X, any use of the new StringDType properties will result in a RuntimeError.
    If you try to use another python module that was compiled against numpy 1.X with numpy 2.X you may see
    the error "A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash.".
    If no newer version of the module is available you will have to use the Numpy 1.X build as above.

  • Add Mutation.inherited_state property which returns the inherited state
    for a single mutation. (@benjeffery, #3277, #2631)

Bugfixes

  • In some tables with mutations out-of-order TableCollection.sort did not re-order
    the mutations so they formed a valid TreeSequence. TableCollection.sort and
    TableCollection.canonicalise now sort mutations by site, then time (if known),
    then the mutation's node's time, then number of descendant mutations
    (ensuring that parent mutations occur before children), then node, then
    their original order in the tables. (@benjeffery, #3257, #3253)

  • Fix bug in TreeSequence.pair_coalescence_counts when span_normalise=True
    and a window breakpoint falls within an internal missing interval.
    (@nspope, #3176, #3175)

  • Fix metadata schemas that are equal but have different byte representations not being equal
    when using TableCollection.assert_equals and Table.assert_equals.
    (@benjeffery, #3246, #3244)

  • k-way statistics no longer require k sample sets, allowing in particular
    "self" comparisons for TreeSequence.genetic_relatedness. This changes the
    error code returned in some situations.
    (@andrewkern, @petrelharp, #3235, #3055)

  • Fix UnboundLocalError in draw_svg() when using numeric max_time
    values with mutations over roots.
    (@benjeffery, #3274, #3273)

  • Prevent iterating over a TopologyCounter
    (@benjeffery , #3202, #1462)

Breaking changes

  • ltrim, rtrim, trim and shift raise an error if used on a tree sequence
    containing a reference sequence (@hyanwong, #3210, #2091)

Python 1.0.0b2

Choose a tag to compare

@github-actions github-actions released this 24 Sep 16:22

Packaging bugfix release

Python 1.0.0b1

Choose a tag to compare

@github-actions github-actions released this 24 Sep 13:25

Breaking Changes

  • For a tree seqeunce to be valid mutation parents in the table collection
    must be correct and consistent with the topology of the tree at each mutation site.
    TableCollection.tree_sequence() will raise a _tskit.LibraryError if this
    is not the case.
    (@benjeffery, #2729, #2732, #3212).

  • Drop Python 3.9 support, require Python >= 3.10 (#3267, @benjeffery)

Features

  • TreeSequence.map_to_vcf_model now also returns the transformed positions and
    contig length. (@benjeffery, #3174, #3173)

  • draw_svg() methods now associate tree branches with edge IDs
    (@hyanwong, #3193, #557)

  • draw_svg() methods now allow the y-axis to be placed on the right-hand side
    using y_axis="right" (@hyanwong, #3201)

  • Add contig_id and isolated_as_missing to VcfModelMapping
    (@benjeffery, #3219, #3177)

  • Add TreeSequence.mutations_edge which returns the edge ID for each mutation's
    edge. (@benjeffery, #3226, #3189)

  • Add TreeSequence.sites_ancestral_state, TreeSequence.mutations_derived_state and
    TreeSequence.mutations_inherited_state properties to return the ancestral state of sites,
    derived state of mutations and inherited state of mutations as NumPy arrays of
    the new numpy 2.0 StringDType.
    (@benjeffery, #3228, #2632, #3276, #2631)

  • Tskit now distributes with a requirement of numpy version 2 or greater. However, you can still use
    tskit with numpy 1.X by building tskit from source with numpy 1.X using pip install tskit --no-binary tskit.
    With numpy 1.X, any use of the new StringDType properties will result in a RuntimeError.
    If you try to use another python module that was compiled against numpy 1.X with numpy 2.X you may see
    the error "A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash.".
    If no newer version of the module is available you will have to use the Numpy 1.X build as above.

  • Add Mutation.inherited_state property which returns the inherited state
    for a single mutation. (@benjeffery, #3277, #2631)

Bugfixes

  • In some tables with mutations out-of-order TableCollection.sort did not re-order
    the mutations so they formed a valid TreeSequence. TableCollection.sort and
    TableCollection.canonicalise now sort mutations by site, then time (if known),
    then the mutation's node's time, then number of descendant mutations
    (ensuring that parent mutations occur before children), then node, then
    their original order in the tables. (@benjeffery, #3257, #3253)

  • Fix bug in TreeSequence.pair_coalescence_counts when span_normalise=True
    and a window breakpoint falls within an internal missing interval.
    (@nspope, #3176, #3175)

  • Fix metadata schemas that are equal but have different byte representations not being equal
    when using TableCollection.assert_equals and Table.assert_equals.
    (@benjeffery, #3246, #3244)

  • k-way statistics no longer require k sample sets, allowing in particular
    "self" comparisons for TreeSequence.genetic_relatedness. This changes the
    error code returned in some situations.
    (@andrewkern, @petrelharp, #3235, #3055)

  • Fix UnboundLocalError in draw_svg() when using numeric max_time
    values with mutations over roots.
    (@benjeffery, #3274, #3273)

Breaking changes

  • ltrim, rtrim, trim and shift raise an error if used on a tree sequence
    containing a reference sequence (@hyanwong, #3210, #2091)