-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98b0aa5
commit 7bd61d5
Showing
6 changed files
with
117 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
(sec_tsbrowse_docs_mainpage)= | ||
|
||
# Tsbrowse documentation | ||
# Tsbrowse documentation | ||
|
||
tsbrowse is an open-source Python package for visualising ARGs in the [tskit](https://tskit.dev/tskit/docs/) tree sequence format. | ||
This is the documentation for tsbrowse, an open-source Python package for visualising ARGs in the [tskit](https://tskit.dev/tskit/docs/) tree sequence format. | ||
|
||
TODO! Add links to other pages | ||
## Contents | ||
### Getting started | ||
This section includes an introduction to tsbrowse, amd notes on how to install and use the app. | ||
[Introduction](intro.md) | ||
[Installing tsbrowse](install.md) | ||
### Pages | ||
This section provides an overview of the various pages displayed in the webapp. | ||
[Overview](overview.md) | ||
[Tables](tables.md) | ||
[Mutations](mutations.md) | ||
[Edges](edges.md) | ||
[Nodes](nodes.md) | ||
[Trees](trees.md) | ||
### Extras | ||
Feedback and bug reports are welcome. This section contains information on contributing and engaging with the tskit community. | ||
[Contributing](contributing.md) | ||
[Changelog](CHANGELOG.md) | ||
[Community](https://tskit.dev/community/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
(install)= | ||
|
||
# Installing tsbrowse | ||
``` | ||
python3 -m pip install tsbrowse | ||
``` | ||
|
||
TODO! Add information on install and deps, then link to intro | ||
To install the development version: | ||
``` | ||
python3 -m pip install git+https://github.com/tskit-dev/tsbrowse | ||
``` | ||
Please also see the documentation on [Contributing](contributing.md). | ||
|
||
# Dependencies | ||
|Package |Minimum supported version| | ||
|-----|--------| | ||
|Datashader|0.16.3| | ||
|Panel|1.5.2| | ||
|Tszip|| | ||
|Tskit|| | ||
|Daiquiri|| | ||
|Hvplot|| | ||
|
||
For an introduction to tsbrowse, see [Introduction](intro.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
(sec_intro)= | ||
|
||
# Introduction to tsbrowse | ||
Tsbrowse is an open-source Python web-app intended as a genome browser for ARGs. It provides interactive visual summaries of the fundamental components of an ARG, i.e. the mutations, nodes, edges and trees it encodes. Tsbrowse operates on ARGs encoded as succinct tree sequences (see [tskit](https://tskit.dev/tskit/docs/stable/introduction.html)). It can be used to inspect biobank-scale ARGs without requiring data uploads to a server. | ||
|
||
# Data Model | ||
## Data Model | ||
The foundation of tsbrowse is the [tskit data model](https://tskit.dev/tskit/docs/stable/data-model.html), which is a generalised ARG representation. Tsbrowse can therefore be applied to ARGs inferred using widely-used methods including [tsinfer](https://tskit.dev/tsinfer/docs/stable/), [Relate](https://myersgroup.github.io/relate/), [ARG-Needle](https://palamaralab.github.io/software/argneedle/) and [SINGER](https://github.com/popgenmethods/SINGER). Tsbrowse augments the underlying tree sequence tables with additional columns to create a compressed `.tsbrowse` file, containing all necessary semantic metadata required for automatic visualisation with the [Holoviz](https://holoviz.org/) ecosystem. | ||
|
||
# How to | ||
TODO! Add a quick start guide with example tree sequences | ||
## How to | ||
Consider an example tree sequence simulated with msprime: | ||
``` | ||
def make_sweep_ts(n, Ne, L, rho=1e-8, mu=1e-8): | ||
sweep_model = msprime.SweepGenicSelection( | ||
position=L/2, start_frequency=0.0001, end_frequency=0.9999, s=0.25, dt=1e-6) | ||
models = [sweep_model, msprime.StandardCoalescent()] | ||
ts = msprime.sim_ancestry( | ||
n, model=models, population_size=Ne, sequence_length=L, recombination_rate=rho, random_seed=1234) | ||
return msprime.sim_mutations(ts, rate=mu, random_seed=4321) | ||
sim_ts = make_sweep_ts(300, Ne=10_000, L=5_000_000, mu=1e-8) | ||
sim_ts.dump("example.trees") | ||
``` | ||
To run tsbrowse on this tree sequence, we first run the preprocessing step. | ||
``` | ||
python -m tsbrowse preprocess example.trees | ||
``` | ||
This creates a `.tsbrowse` file in the same directory as the input tree sequence. | ||
We can then run the serve step to view the app in a web browser: | ||
``` | ||
python -m tsbrowse serve example.tsbrowse --port 8080 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters