|
1 | 1 | # tsbrowse
|
2 |
| -Inspect large genetic genealogies (e.g. ARGs) stored in the [tskit](https://tskit.dev) "succinct tree sequence" format, |
3 |
| -via a genome browser style app. _Tsbrowse_ can deal with ARGs of thousands or potentially millions of samples. |
| 2 | +Inspect large genetic genealogies (e.g. ARGs) stored in the [tskit](https://tskit.dev) "succinct tree sequence" format, via a web app. |
| 3 | +_Tsbrowse_ can scale to ARGs with millions of samples. |
| 4 | + |
4 | 5 | It is particularly useful to help evaluate ARGs that have been inferred using tools such as
|
5 | 6 | [tsinfer](https://github.com/tskit-dev/tsinfer),
|
6 | 7 | [sc2ts](https://github.com/tskit-dev/sc2ts),
|
7 | 8 | [Relate](https://github.com/MyersGroup/relate),
|
8 | 9 | [KwARG](https://github.com/a-ignatieva/kwarg),
|
9 | 10 | [Threads](https://pypi.org/project/threads-arg/), etc.
|
10 | 11 |
|
11 |
| -To view a tskit tree sequence or tszip file first pre-process it: |
| 12 | +## Quickstart |
12 | 13 |
|
13 |
| -`python -m tsbrowse preprocess /path/to/trees-file` |
| 14 | +First install `tsbrowse` from PyPI: |
| 15 | + |
| 16 | +`python -m pip install tsbrowse` |
| 17 | + |
| 18 | +A tskit tree sequence must first be preprocessed to a `.tsbrowse` file: |
14 | 19 |
|
15 |
| -This will write a `.tsbrowse` file |
| 20 | +`python -m tsbrowse preprocess /path/to/trees-file` |
16 | 21 |
|
17 |
| -To launch the app use: |
| 22 | +This will write a `.tsbrowse` file that can then be viewed using the web app: |
18 | 23 |
|
19 | 24 | `python -m tsbrowse serve /path/to/tsbrowse-file`
|
20 | 25 |
|
| 26 | +This command will launch a web server that can be accessed at `http://localhost:8080` in a web browser. |
| 27 | + |
21 | 28 | To display the genes track use:
|
22 | 29 |
|
23 | 30 | `python -m tsbrowse serve /path/to/tsbrowse-file --annotations-file genes.`
|
24 | 31 |
|
25 | 32 | (where `genes.csv` is a semicolon-separated text file containing no header and information about one gene on a row in the order: `chr;start;end;strand;ensembl ID;gene name`)
|
26 | 33 |
|
27 |
| -To generate a PNG of a specific page use, e.g: |
| 34 | +An example tree sequence file can be found here: [example.trees](https://raw.githubusercontent.com/tskit-dev/tsbrowse/refs/heads/main/example/example.trees.tsz). |
28 | 35 |
|
29 |
| -`python -m tsbrowse screenshot /path/to/tsbrowse-file mutations` |
| 36 | +## Tips |
30 | 37 |
|
31 |
| -On WSL, it may be necessary to disable Numba's CUDA support: |
| 38 | +If you are using Windows Subsystem for Linux (WSL) you may need to disable Numba's CUDA support: |
32 | 39 |
|
33 | 40 | `NUMBA_DISABLE_CUDA=1 python -m tsbrowse serve /path/to/tsbrowse-file`
|
34 | 41 |
|
35 |
| -## Installation |
| 42 | +A PNG of a specific page in tsbrowse can be generated using the `screenshot` command: |
36 | 43 |
|
37 |
| -tsbrowse is currently in development. To install the latest dev version from github, try |
| 44 | +`python -m tsbrowse screenshot /path/to/tsbrowse-file mutations` |
38 | 45 |
|
39 |
| -``` |
40 |
| -python -m pip install git+https://github.com/tskit-dev/tsbrowse |
41 |
| -``` |
42 | 46 |
|
43 | 47 | ## Development
|
44 | 48 |
|
|
0 commit comments