Skip to content

Releases: tskit-dev/tskit

C API 0.99.5

27 Aug 13:08
23c84e3

Choose a tag to compare

Breaking changes

  • The macro TSK_IMPUTE_MISSING_DATA is renamed to TSK_ISOLATED_NOT_MISSING (@benjeffery, #716, #794).

New features

  • Add a TSK_KEEP_INPUT_ROOTS option to simplify which, if enabled, adds edges from the MRCAs of samples in the simplified tree sequence back to the roots in the input tree sequence (@jeromekelleher, #775, #782).

Python 0.3.0beta2

13 Aug 10:10
c234a30

Choose a tag to compare

Python 0.3.0beta2 Pre-release
Pre-release

BETA PRE-RELEASE

Second beta of 0.3.0

Changes from beta 1

  • Mutation times can be a mixture of known and unknown as long as for each individual site they are either all known or all unknown (@benjeffery, #761).

  • Metadata and schemas are stored as canonical JSON to aid byte-wise comparison. Metadata schemas have improved equality methods. (@benjeffery, #764).

Bugfixes

  • Fix too small buffer for newick, causing LibraryError for tree.newick() (@jeromekelleher, #754).

C API 0.99.4

12 Aug 09:35
05f8d40

Choose a tag to compare

Note

  • The TSK_VERSION_PATCH macro was incorrectly set to 4 for 0.99.3, so both
    0.99.4 and 0.99.3 have the same value.

Changes

  • Mutation times can be a mixture of known and unknown as long as for each
    individual site they are either all known or all unknown (@benjeffery, #761).

Bugfixes

Python 0.3.0.beta1

29 Jul 14:28
ed2935f

Choose a tag to compare

Python 0.3.0.beta1 Pre-release
Pre-release

BETA PRE-RELEASE

Major feature release for metadata schemas, set-like operations, mutation times,
SVG drawing improvements and many others. This release comes with wheels for windows, os and linux.

Breaking changes

  • The default display order for tree visualisations has been changed to minlex (see below) to stabilise the node ordering and to make trees more readily comparable. The old behaviour is still available with order="tree".

  • File system operations such as dump/load now raise an appropriate OSError instead of tskit.FileFormatError. Loading from an empty file now raises and EOFError.

  • Bad tree topologies are detected earlier, so that it is no longer possible to create a TreeSequence object which contains a parent with contradictory children on an interval. Previously an error was thrown when some operation building the trees was attempted (@jeromekelleher, #709).

  • The TableCollection object no longer implements the iterator protocol. Previously list(tables) returned a sequence of (table_name, table_instance) tuples. This has been replaced with the more intuitive and future-proof TableCollection.name_map and TreeSequence.tables_dict attributes, which perform the same function (@jeromekelleher, #500, #694).

New features

  • New methods to perform set operations on TableCollections and TreeSequences. TableCollection.subset subsets and reorders table collections by nodes (@mufernando, @petrelharp, #663, #690). TableCollection.union forms the node-wise union of two table collections (@mufernando, @petrelharp, #381 #623).

  • Mutations now have an optional double-precision floating-point time column. If not specified, this defaults to a particular NaN value (tskit.UNKNOWN_TIME) indicating that the time is unknown. For a tree sequence to be considered valid it must meet new criteria for mutation times, see :ref:sec_mutation_requirements. Also added function TableCollection.compute_mutation_times. Table sorting orders mutations by non-increasing time per-site, which is also a requirement for a valid tree sequence (@benjeffery, #672).

  • Add support for trees with internal samples for the Kendall-Colijn tree distance metric. (@daniel-goldstein, #610)

  • Add background shading to SVG tree sequences to reflect tree position along the sequence (@hyanwong, #563).

  • Tables with a metadata column now have a metadata_schema that is used to validate and encode metadata that is passed to add_row and decode metadata on calls to table[j] and e.g. tree_sequence.node(j) See :ref:sec_metadata (@benjeffery, #491, #542, #543, #601).

  • The tree-sequence now has top-level metadata with a schema (@benjeffery, #666, #644, #642).

  • Add classes to SVG drawings to allow easy adjustment and styling, and document the new tskit.Tree.draw_svg() and tskit.TreeSequence.draw_svg() methods. This also fixes #467 for duplicate SVG entity id s in Jupyter notebooks (@hyanwong, #555).

  • Add a nexus function that outputs a tree sequence in Nexus format (@saunack, #550).

  • Add extension of Kendall-Colijn tree distance metric for tree sequences computed by TreeSequence.kc_distance (@daniel-goldstein, #548).

  • Add an optional node traversal order in tskit.Tree that uses the minimum lexicographic order of leaf nodes visited. This ordering ("minlex_postorder") adds more determinism because it constraints the order in which children of a node are visited (@brianzhang01, #411).

  • Add an order argument to the tree visualisation functions which supports two node orderings: "tree" (the previous default) and "minlex" which stabilises the node ordering (making it easier to compare trees). The default node ordering is changed to "minlex" (@brianzhang01, @jeromekelleher, #389, #566).

  • Add _repr_html_ to tables, so that jupyter notebooks render them as html tables (@benjeffery, #514).

  • Remove support for kc_distance on trees with unary nodes (@daniel-goldstein, #508).

  • Improve Kendall-Colijn tree distance algorithm to operate in O(n^2) time instead of O(n^2 * log(n)) where n is the number of samples (@daniel-goldstein, #490).

  • Add a metadata column to the migrations table. Works similarly to existing metadata columns on other tables (@benjeffery, #505).

  • Add a metadata column to the edges table. Works similarly to existing metadata columns on other tables (@benjeffery, #496).

  • Allow sites with missing data to be output by the haplotypes method, by default replacing with -. Errors are no longer raised for missing data with impute_missing_data=False; the error types returned for bad alleles (e.g. multiletter or non-ascii) have also changed from _tskit.LibraryError to TypeError, or ValueError if the missing data character clashes (@hyanwong, #426).

  • Access the number of children of a node in a tree directly using tree.num_children(u) (@hyanwong, #436).

  • User specified allele mapping for genotypes in variants and genotype_matrix (@jeromekelleher, #430).

  • New root_threshold option for the Tree class, which allows us to efficiently iterate over 'real' roots when we have missing data (@jeromekelleher, #462).

  • Add pickle support for TreeSequence (@terhorst, #473).

  • Add tree.as_dict_of_dicts() function to enable use with networkx. See :ref:sec_tutorial_networkx (@winni2k, #457).

Bugfixes

Deprecated

  • The sample_counts feature has been deprecated and is now ignored. Sample counts are now always computed.

C API 0.99.3

27 Jul 14:46
ab54128

Choose a tag to compare

C API 0.99.3 Pre-release
Pre-release

C API release.

Breaking changes

  • tsk_mutation_table_add_row has an extra time argument. If the time is unknown TSK_UNKNOWN_TIME should be passed. (@benjeffery, #672)
  • Change genotypes from unsigned to signed to accommodate missing data. (see #144 for discussion). This only affects users of the tsk_vargen_t class. Genotypes are now stored as int8_t and int16_t types rather than the former unsigned types. The field names in the genotypes union of the tsk_variant_t struct returned by tsk_vargen_next have been renamed to i8 and i16 accordingly; care should be taken when updating client code to ensure that types are correct. The number of distinct alleles supported by 8 bit genotypes has therefore dropped from 255 to 127, with a similar reduction for 16 bit genotypes.
  • Change the tsk_vargen_init method to take an extra parameter alleles. To keep the current behaviour, set this parameter to NULL.
  • Edges can now have metadata. Hence edge methods now take two extra arguments: metadata and metadata length. The file format has also changed to accommodate this, but is backwards compatible. Edge metadata can be disabled for a table collection with the TSK_NO_EDGE_METADATA flag. (@benjeffery, #496, #712)
  • Migrations can now have metadata. Hence migration methods now take two extra arguments: metadata and metadata length. The file format has also changed to accommodate this, but is backwards compatible. (@benjeffery, #505)
  • The text dump of tables with metadata now includes the metadata schema as a header. (@benjeffery, #493)
  • Bad tree topologies are detected earlier, so that it is no longer possible to create a tsk_treeseq_t object which contains a parent with contradictory children on an interval. Previously an error occurred when some operation building the trees was attempted. (@jeromekelleher, #709)

New features

  • New methods to perform set operations on table collections. tsk_table_collection_subset subsets and reorders table collections by nodes (@mufernando, @petrelharp, #663, #690). tsk_table_collection_union forms the node-wise union of two table collections. (@mufernando, @petrelharp, #381, #623)
  • Mutations now have an optional double-precision floating-point time column. If not specified, this defaults to a particular NaN value (TSK_UNKNOWN_TIME) indicating that the time is unknown. For a tree sequence to be considered valid it must meet new criteria for mutation times, see Mutation requirements. Add tsk_table_collection_compute_mutation_times and new flag to tsk_table_collection_check_integrity:TSK_CHECK_MUTATION_TIME. Table sorting orders mutations by non-increasing time per-site, which is also a requirement for a valid tree sequence. (@benjeffery, #672)
  • Add metadata and metadata_schema fields to table collection, with accessors on tree sequence. These store arbitrary bytes and are optional in the file format. (:user: benjeffery, #641)
  • Add the TSK_KEEP_UNARY option to simplify (@gtsambos). See #1 and #143.
  • Add a set_root_threshold option to tsk_tree_t which allows us to set the number of samples a node must be an ancestor of to be considered a root. (#462)
  • Change the semantics of tsk_tree_t so that sample counts are always computed, and add a new TSK_NO_SAMPLE_COUNTS option to turn this off. (#462)
  • Tables with metadata now have an optional metadata_schema field that can contain arbitrary bytes. (@benjeffery, #493)
  • Tables loaded from a file can now be edited in the same way as any other table collection (@jeromekelleher, #536, #530)
  • Support for reading/writing to arbitrary file streams with the loadf/dumpf variants for tree sequence and table collection load/dump. (@jeromekelleher, @grahamgower, #565, #599)
  • Add low-level sorting API and TSK_NO_CHECK_INTEGRITY flag. (@jeromekelleher, #627, #626)
  • Add extension of Kendall-Colijn tree distance metric for tree sequences computed by tsk_treeseq_kc_distance (@daniel-goldstein, #548)

Deprecated

  • The TSK_SAMPLE_COUNTS options is now ignored and will print out a warning if used. (#462)

Minor feature release

22 Nov 15:37
842996b

Choose a tag to compare

Minor feature release, providing a tree distance metric and various method to manipulate tree sequence data.

New features

Bugfixes

Bugfix release

01 Sep 09:46
8759e8c

Choose a tag to compare

Minor bugfix release.

Relaxes overly-strict input requirements on individual location data that caused some SLiM tree sequences to fail loading in version 0.2.1(see :issue:351).

New features

  • Add log_time height scaling option for drawing SVG tree (:user:marianne-aspbury). See :pr:324 and :issue:303.

Bugfixes

  • Allow 4G metadata columns (:user:jeromekelleher). See :pr:342 and :issue:341.

Major feature release

23 Aug 16:48
67a8335

Choose a tag to compare

Major feature release, adding support for population genetic statistics,
improved VCF output and many other features.

Note: Version 0.2.0 was skipped because of an error uploading to PyPI
which could not be undone.

Breaking changes

  • Genotype arrays returned by TreeSequence.variants and
    TreeSequence.genotype_matrix have changed from unsigned 8 bit values
    to signed 8 bit values to accomodate missing data (see :issue:144 for
    discussion). Specifically, the dtype of the genotypes arrays have changed
    from numpy "u8" to "i8". This should not affect client code in any way
    unless it specifically depends on the type of the returned numpy array.

  • The VCF written by the write_vcf is no longer compatible with previous
    versions, which had significant shortcomings. Position values are now rounded
    to the nearest integer by default, REF and ALT values are derived from the
    actual allelic states (rather than always being A and T). Sample names
    are now of the form tsk_j for sample ID j. Most of the legacy behaviour
    can be recovered with new options, however.

  • The positional parameter reference_sets in genealogical_nearest_neighbours
    and mean_descendants TreeSequence methods has been renamed to
    sample_sets.

New features

  • Support for general windowed statistics. Implementations of diversity,
    divergence, segregating sites, Tajima's D, Fst, Patterson's F statistics,
    Y statistics, trait correlations and covariance, and k-dimensional allele
    frequency specra (:user:petrelharp, :user:jeromekelleher, :user:molpopgen).

  • Add the keep_unary option to simplify (:user:gtsambos). See :issue:1
    and :pr:143.

  • Add the map_ancestors method to TableCollection (user:gtsambos). See :pr:175.

  • Add the squash method to EdgeTable (:user:gtsambos). See :issue:59 and
    :pr:285.

  • Add support for individuals to VCF output, and fix major issues with output
    format (:user:jeromekelleher). Position values are transformed in a much
    more straightforward manner and output has been generalised substantially.
    Adds individual_names and position_transform arguments.
    See :pr:286, and issues :issue:2, :issue:30 and :issue:73.

  • Control height scale in SVG trees using 'tree_height_scale' and 'max_tree_height'
    (:user:hyanwong, :user:jeromekelleher). See :issue:167, :pr:168.
    Various other improvements to tree drawing (:pr:235, :pr:241, :pr:242,
    :pr:252, :pr:259).

  • Add Tree.max_root_time property (:user:hyanwong, :user:jeromekelleher).
    See :pr:170.

  • Improved input checking on various methods taking numpy arrays as parameters
    (:user:hyanwong). See :issue:8 and :pr:185.

  • Define the branch length over roots in trees to be zero (previously raise

  • Implementation of the genealogical nearest neighbours statistic
    (:user:hyanwong, :user:jeromekelleher).

  • New delete_intervals and keep_intervals method for the TableCollection
    to allow slicing out of topology from specific intervals (:user:hyanwong,
    :user:andrewkern, :user:petrelharp, :user:jeromekelleher). See
    :pr:225 and :pr:261.

  • Support for missing data via a topological definition (:user:jeromekelleher).
    See :issue:270 and :pr:272.

  • Add ability to set columns directly in the Tables API (:user:jeromekelleher).
    See :issue:12 and :pr:307.

  • Various documentation improvements from :user:brianzhang, :user:hyanwong,
    :user:petrelharp and :user:jeromekelleher.

Deprecated

  • Deprecate Tree.length in favour of Tree.span (:user:hyanwong).
    See :pr:169.

  • Deprecate TreeSequence.pairwise_diversity in favour of the new
    diversity method. See :issue:215, :pr:312.

Bugfixes

  • Catch NaN and infinity values within tables (:user:hyanwong).
    See :issue:293 and :pr:294.

Alpha access to AFS and VCF updates

13 Aug 15:10
056939f

Choose a tag to compare

Pre-release

An alpha release for testing new stats, allele frequency spectrum and VCF updates.

Alpha access to general stats

14 Jun 13:42
defa0f3

Choose a tag to compare

Pre-release

Alpha release to give early access to new stats and drawing APIs.