Crate forrustts[][src]

Rust library for forward time population genetic simulation with tree sequence recording.

Overview

This package is a port of many ideas from fwdpp from C++ to rust.

Currently, this should be viewed as experimental.

Differences from tskit

The tables model differs from tskit in some important ways:

  1. Time moves from the past to the present. Thus, child nodes have time values greater than those of their parents.
  2. The data layout is “array of structures” while tskit is a “structure of arrays”.
  3. Metadata is not part of the tables. Often, what one thinks of as metadata is data used during the simulation. Thus, it is not part of a TableCollection and is something that would only be useful to write when transfering final results to a tskit::TableCollection.
  4. Mutation table data are different. See MutationRecord.
  5. Time is measured as an integer (see Time), as are genomic locations (see Position). In tskit, both are C double, the equivalent of f64.

Where to find examples

In the examples/ directory of the project repository.

Modules

nested_forward_list

Compact representation of multiple forward linked lists.

tskit_tools

Data interchange to tskit format using tskit.

Structs

Edge

An Edge is a transmission event

MutationRecord

A MutationRecord is the minimal information needed about a mutation to track it on a tree sequence.

Node

A Node of a tree sequence

SamplesInfo

Information about samples used for table simpilfication.

Segment

A segment is a half-open interval of crate::Positions associated with a crate::Node.

SimplificationBuffers

Holds internal memory used by simplification machinery.

SimplificationFlags

Boolean flags affecting simplification behavior.

SimplificationOutput

Useful information output by table simplification.

Site

A Site is the location and ancestral state of a tables::MutationRecord

TableCollection

A collection of node, edge, site, and mutation tables.

TableSortingFlags

Modifies behavior of TableCollection::sort_tables

TableValidationFlags

Modifies behavior of TableCollection::validate

Enums

ForrusttsError

Primary error type.

TablesError

Error type related to TableCollection

Statics

NULL_ID

Equals -1 (minus one). Primary use is to indicate a null Node id.

Functions

simplify_from_edge_buffer

Simplify a TableCollection from an EdgeBuffer.

simplify_tables

Simplify a TableCollection.

simplify_tables_without_state

Simplify a TableCollection.

validate_edge_table

Perform a data integrity check on an EdgeTable.

version

Get the forrustts version number.

Type Definitions

EdgeBuffer

Data type used for edge buffering. Simplification of simulated data happens via crate::simplify_from_edge_buffer().

EdgeTable

An edge table

IdType

Integer type used to refer to Node objects.

MutationTable

A Mutation table

NodeTable

A node table

Position

Integer type used to refer to a genomic coordinate/position

SiteTable

A site table

TablesResult

Result type for operations on tables

Time

Time is recorded as a discrete, signed integer.