Interactive visualization with Lorax

Standard graph visualization tools such as GraphMakie (made available by plot_genealogy) are of limited use when dealing with even moderately large ancestries. For that purpose, we recommend Lorax, a web platform specifically designed for interactive visualization of ancestral recombination graphs. While a public instance is available, it has also been packaged with Moonshine since version 0.4.3 and can be used entirely locally via the lorax method. Below are three ways to do so.

Visualize ancestries on the fly

The easiest way to use Lorax is to call lorax on an object that has a ts method defined (e.g., an Arg). Conversion to TreeSequence is handled automatically, and the resulting object is loaded into a new local Lorax instance.

arg = Arg(rng, 10, 1e-7, 1e-7, 10000, 1e6)build!(rng, arg)lorax(arg)

Lorax binds to port 3000 on localhost by default. This can be configured via the host and port keyword arguments.

Visualize an ARG stored in a file

lorax accepts a path to a file compatible with Lorax (details).

lorax("my-arg.trees")lorax("my-compressed-arg.trees.tsz")lorax("my-newick-encoded-arg.csv")

Interactive session

lorax can be called without arguments:

lorax()

In that case, ARGs can be loaded from files interactively via the web interface, similar to https://lorax.ucsc.edu.

References