Skip to main content

Webapp to view and visualise the information structure in tskit ARGs

Project description

tsbrowse

License PyPI version Supported Python Versions Docs Build Tests Inspect large genetic genealogies (e.g. ARGs) stored in the tskit "succinct tree sequence" format, via a web app. Tsbrowse can scale to ARGs with millions of samples.

Documentation: https://tskit.dev/tsbrowse/docs/stable/ (latest: https://tskit.dev/tsbrowse/docs/latest/)

It is particularly useful to help evaluate ARGs that have been inferred using tools such as tsinfer, sc2ts, Relate, Threads, etc.

Quickstart

Installation

Install from PyPI:

python -m pip install tsbrowse

A tskit tree sequence must first be preprocessed to a .tsbrowse file:

python -m tsbrowse preprocess /path/to/trees-file

This will write a .tsbrowse file that can then be viewed using the web app:

python -m tsbrowse serve /path/to/tsbrowse-file

This command will launch a web server that can be accessed at http://localhost:8080 in a web browser.

To display the genes track use:

python -m tsbrowse serve /path/to/tsbrowse-file --annotations-file genes.csv

(where genes.csv is a semicolon-separated text file containing a header and information about one gene per row in the order: chr;start;end;strand;ensembl ID;gene name)

An example tree sequence file can be found here: example.trees.

Tips

If you are using Windows Subsystem for Linux (WSL) you may need to disable Numba's CUDA support:

NUMBA_DISABLE_CUDA=1 python -m tsbrowse serve /path/to/tsbrowse-file

A PNG of a specific page in tsbrowse can be generated using the screenshot command:

python -m tsbrowse screenshot /path/to/tsbrowse-file mutations

Development

Tests are run with pytest:

python -m pytest

To run the UI tests so you can see what the browser is doing use

python -m pytest --headed --slowmo 1000 tests/test_ui.py

playwright codegen is also useful for writing UI test code.

Citing tsbrowse

If you use tsbrowse in your work, please cite this paper

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsbrowse-0.1.0.tar.gz (397.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsbrowse-0.1.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file tsbrowse-0.1.0.tar.gz.

File metadata

  • Download URL: tsbrowse-0.1.0.tar.gz
  • Upload date:
  • Size: 397.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tsbrowse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1975dfefa4692ebf024253ca2c3d0db568944a50ec68b5bac2e8da32cd178cbc
MD5 2af257aa0f23e98e7a5053f388522772
BLAKE2b-256 0e556b9bcabb3df2e2774336909814ff70a639b803e9a53cf64c5943ed6a729e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsbrowse-0.1.0.tar.gz:

Publisher: release.yml on tskit-dev/tsbrowse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsbrowse-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tsbrowse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tsbrowse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26e37777ce3472459777ccc9ec14ad84e5f0dec3d21223d6da4a58c373da6454
MD5 f981e250ffc34a8028eb5fdd030b6148
BLAKE2b-256 bd011dbc59be4c19dd9b35da202502b8d5249ce47bdd9e34406d8852f54ce6f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsbrowse-0.1.0-py3-none-any.whl:

Publisher: release.yml on tskit-dev/tsbrowse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page