Module plain_text

Source
Expand description

Reading and writing for the plain text SFS format.

The plain text format is a simple format consisting of two lines. The first line contains a header line #SHAPE=<[shape]>, where [shape] is a /-separated representation of the shape of the SFS. The next line gives the SFS in flat, row-major order separated by a single space.

In other words, the plain text format is like the format output by realSFS, except with the addition of a header line so that the SFS can be read without passing the shape separately.

Structs§

ParseHeaderError
An error associated with parsing the plain text format header.

Functions§

read_sfs
Reads an SFS in plain text format from a reader.
read_sfs_from_path
Reads an SFS in plain text format from a file path.
write_sfs
Writes an SFS in plain text format to a writer.
write_sfs_to_path
Writes an SFS in plain text format to a file path.