Skip to content

Commit 793faad

Browse files
authored
Merge pull request #236 from benjeffery/example
Update readme and add example.trees
2 parents aff7de5 + 302f752 commit 793faad

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

README.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
11
# 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+
45
It is particularly useful to help evaluate ARGs that have been inferred using tools such as
56
[tsinfer](https://github.com/tskit-dev/tsinfer),
67
[sc2ts](https://github.com/tskit-dev/sc2ts),
78
[Relate](https://github.com/MyersGroup/relate),
89
[KwARG](https://github.com/a-ignatieva/kwarg),
910
[Threads](https://pypi.org/project/threads-arg/), etc.
1011

11-
To view a tskit tree sequence or tszip file first pre-process it:
12+
## Quickstart
1213

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:
1419

15-
This will write a `.tsbrowse` file
20+
`python -m tsbrowse preprocess /path/to/trees-file`
1621

17-
To launch the app use:
22+
This will write a `.tsbrowse` file that can then be viewed using the web app:
1823

1924
`python -m tsbrowse serve /path/to/tsbrowse-file`
2025

26+
This command will launch a web server that can be accessed at `http://localhost:8080` in a web browser.
27+
2128
To display the genes track use:
2229

2330
`python -m tsbrowse serve /path/to/tsbrowse-file --annotations-file genes.`
2431

2532
(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`)
2633

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).
2835

29-
`python -m tsbrowse screenshot /path/to/tsbrowse-file mutations`
36+
## Tips
3037

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:
3239

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

35-
## Installation
42+
A PNG of a specific page in tsbrowse can be generated using the `screenshot` command:
3643

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`
3845

39-
```
40-
python -m pip install git+https://github.com/tskit-dev/tsbrowse
41-
```
4246

4347
## Development
4448

example/example.trees.tsz

346 KB
Binary file not shown.

tsbrowse/__main__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def preprocess(tszip_path, output, verbose):
113113

114114
preprocess_.preprocess(tszip_path, output, show_progress=True)
115115
logger.info(f"Preprocessing completed. Output saved to: {output}")
116-
print(f"Preprocessing completed. You can now view with `tsbrowse serve {output}`")
116+
print(
117+
"Preprocessing completed. You can now view with "
118+
f"`python -m tsbrowse serve {output}`"
119+
)
117120

118121

119122
@cli.command()

0 commit comments

Comments
 (0)