Python 1.0.0b1
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.LibraryErrorif 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_modelnow 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
usingy_axis="right"(@hyanwong, #3201) -
Add
contig_idandisolated_as_missingtoVcfModelMapping
(@benjeffery, #3219, #3177) -
Add
TreeSequence.mutations_edgewhich returns the edge ID for each mutation's
edge. (@benjeffery, #3226, #3189) -
Add
TreeSequence.sites_ancestral_state,TreeSequence.mutations_derived_stateand
TreeSequence.mutations_inherited_stateproperties 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 usingpip install tskit --no-binary tskit.
With numpy 1.X, any use of the new StringDType properties will result in aRuntimeError.
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_stateproperty which returns the inherited state
for a single mutation. (@benjeffery, #3277, #2631)
Bugfixes
-
In some tables with mutations out-of-order
TableCollection.sortdid not re-order
the mutations so they formed a valid TreeSequence.TableCollection.sortand
TableCollection.canonicalisenow 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_countswhenspan_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 usingTableCollection.assert_equalsandTable.assert_equals.
(@benjeffery, #3246, #3244) -
k-way statistics no longer require k sample sets, allowing in particular
"self" comparisons forTreeSequence.genetic_relatedness. This changes the
error code returned in some situations.
(@andrewkern, @petrelharp, #3235, #3055) -
Fix
UnboundLocalErrorindraw_svg()when using numericmax_time
values with mutations over roots.
(@benjeffery, #3274, #3273)
Breaking changes