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.1.tar.gz (574.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.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tsbrowse-0.1.1.tar.gz
  • Upload date:
  • Size: 574.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tsbrowse-0.1.1.tar.gz
Algorithm Hash digest
SHA256 58cd3c86dcbc8a24362f5283f68726b733352ebbdce0aeee1145c831a9dfeb29
MD5 9172bead0705e3af936e48c0de7814d4
BLAKE2b-256 dfc348f937ec80beb5ae3325b8c9403c86a69741476cfbf01ba201eece3761b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsbrowse-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: tsbrowse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tsbrowse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c344cc31dd666adc7f854390b6d36a77c41e8db8e7a1beb1f357f4871ed24f6
MD5 24354c83705db0c6ab22966cadb145ef
BLAKE2b-256 bf877009852e35b829ce49e8a9a2dcb6f60b659c0c71bf5bcc2b00c0034458d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsbrowse-0.1.1-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