Skip to content

Commit 7f5a533

Browse files
authored
Merge pull request #90 from zhou-ran/main
update the doc of installation
2 parents 4f83500 + 7a69bdd commit 7f5a533

2 files changed

Lines changed: 83 additions & 106 deletions

File tree

README.md

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,37 @@ and each track on output corresponds these datasets from config file.
4646

4747
## Usage
4848

49-
The trackplot is written in **Python3** `(python_requires='>=3.8')`, and user could install it in a variety of ways as follows
49+
Trackplot is based on **Python3** `(python_requires='>=3.8')`,
50+
and we have simplified the installation process on the main page.
51+
For a more comprehensive installation guide, please refer to [this link](./docs/installation.md).
5052

53+
### For impatient
54+
55+
```shell
56+
pip install trackplot
57+
trackplot --help
58+
59+
# or
60+
61+
conda create -n trackplot -c bioconda -c conda-forge trackplot
62+
conda activate trackplot
63+
trackplot --help
64+
65+
```
5166

5267
###### Notes
53-
>1. For **microsoft windows**, **mac (apple silicon)** and **other arm platform** users,
54-
due to pysam, pybigwig and hicmatrix do not support those platforms,
55-
trackplot couldn't be installed by pypi or conda,
56-
pleas use docker image as alternative
57-
>2. if `segment fault` with multiple processing, please try to use docker image, or just run with `-p 1`.
58-
>3. if `Please install pyBigWig and hicmatrix` occurs, please check the official document of
59-
[pyBigWig](https://github.com/deeptools/pyBigWig) and [hicmatrix](https://github.com/deeptools/HiCMatrix)
60-
to solve their requirements.
68+
>1. For users on **Microsoft Windows**, **Mac (Apple Silicon)**,
69+
and **other ARM platforms**,
70+
please note that Trackplot may not be installable via PyPI or Conda due to compatibility issues with pysam,
71+
pybigwig, and hicmatrix libraries on these platforms.
72+
As an alternative, we recommend using the Docker image for installation.
73+
74+
>2. If you encounter a `segment fault` error during multiple processing,
75+
you may want to consider using the Docker image or running the command with the `-p 1` flag.
76+
77+
>3. If you encounter the message `Please install pyBigWig and hicmatrix`,
78+
you can refer to the official documentation for [pyBigWig](https://github.com/deeptools/pyBigWig) and
79+
[hicmatrix](https://github.com/deeptools/HiCMatrix) to fulfill their requirements and resolve the issue.
6180

6281

6382
### Using trackplot by a command line
@@ -77,25 +96,7 @@ pip install trackplot
7796

7897
2. [AppImage](https://github.com/ygidtu/trackplot/releases) (Linux/WSL x86_64 platform only)
7998

80-
81-
All the AppImage files were tested on the official pre-built GNU/Linux distributions docker images:
82-
- Arch: `appimagecrafters/tests-env:archlinux-latest`
83-
- Fedora: `appimagecrafters/tests-env:fedora-30`
84-
- Debian: `appimagecrafters/tests-env:debian-stable`
85-
- Ubuntu: `appimagecrafters/tests-env:ubuntu-bionic`
86-
- Centos: `appimagecrafters/tests-env:centos-7`
87-
88-
>Due to the limitation of AppImage technic itself, we only provide AppImage for Linux and Windows subsystem for Linux (x86_64 platform) users.
89-
Once you have installation issues and not familiar with docker,
90-
please download the AppImage file from our releases.
91-
>
92-
> Once the AppImage file couldn't work properly please open an issue in this repo,
93-
and provide us the system platform and full error messages for us to debug.
94-
>
95-
> **Notes:**
96-
> 1. the AppImage will decompress all bundled files before execution,
97-
> therefore it will a little bit slower than command line tools and source code
98-
> 2. please use absolute path instead of relative path.
99+
For a binary version of the tool and more comprehensive information, please visit [this link](./docs/installation.md).
99100

100101
```bash
101102
# example with version v0.3.2, please using your interested version according to your needs
@@ -108,8 +109,6 @@ chmod +x trackplot-${VERSION}-x86_64.AppImage
108109

109110
3. using docker image
110111

111-
> Known issue: the logging time may have several hours mismatch with your local time, due to timezone settings inner the image.
112-
113112
```bash
114113
docker pull ygidtu/trackplot
115114
docker run --rm ygidtu/trackplot --help
@@ -120,17 +119,6 @@ docker run --rm ygidtu/trackplot --help
120119

121120
4. install from bioconda
122121

123-
First make sure your conda is properly installed.
124-
125-
```bash
126-
# Check if conda has been successfully installed.
127-
conda --version
128-
129-
# if conda is not installed, refer to https://conda.io/projects/conda/en/latest/user-guide/install/download.html
130-
```
131-
132-
After successful installation
133-
134122
```bash
135123
# install trackplot into the default conda env
136124
conda install -c bioconda -c conda-forge trackplot
@@ -145,8 +133,6 @@ trackplot --help
145133

146134
---
147135

148-
For additional installation information please visit [here.](https://trackplot.readthedocs.io/en/latest/)
149-
150136
### Using trackplot by a local webserver
151137

152138
1. [AppImage](https://github.com/ygidtu/trackplot/releases) (Linux/WSL x86_64 only)
@@ -189,7 +175,7 @@ docker run --name trackplot \
189175
`-p`: public and private port for the server, default:5000(public):5000(private)
190176
- `-v`, `--volume`: mount the working directory to docker container, for example, the `$PWD/data` could replace by the path to your directory contains all necessary data
191177
- `--user`: prevent docker read and write file using root privileges
192-
- the rest usage please check [Command line usage](./command.md)
178+
193179

194180
---
195181

docs/installation.md

Lines changed: 53 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1+
## Using trackplot by a command line
12

2-
## Install with pypi, conda or docker
3-
4-
### Notes
5-
>1. For **windows**, **mac(apple silicon)** and **other arm** users, due to several requirements pysam, pybigwig and hicmatrix do not support those platforms, pleas use docker image as alternative
6-
>2. if `segment fault` with multiple processing, please try to use docker image, or just run with `-p 1`.
7-
>3. if `Please install pyBigWig and hicmatrix` occurs, please check the official document of
8-
[pyBigWig](https://github.com/deeptools/pyBigWig) and [hicmatrix](https://github.com/deeptools/HiCMatrix)
9-
to solve their requirements.
10-
11-
### PyPi
3+
1. install from PyPi
124

135
Before running this command line, please check python (>=3.8) was installed.
146

@@ -19,10 +11,13 @@ pip install pybigwig hicmatrix
1911
pip install trackplot
2012
# __Note:__ We noticed some pypi mirrors are not syncing some packages we depend on,
2113
# therefore please try another pypi mirror once you encounter
22-
# `No local packages or working download links found for xxx`
14+
# `No local packages or working download links found for xxx`
2315
```
16+
2417
---
25-
### AppImage (Linux/WSL x86_64 platform only)
18+
19+
2. [AppImage](https://github.com/ygidtu/trackplot/releases) (Linux/WSL x86_64 platform only)
20+
2621

2722
All the AppImage files were tested on the official pre-built GNU/Linux distributions docker images:
2823
- Arch: `appimagecrafters/tests-env:archlinux-latest`
@@ -31,7 +26,7 @@ All the AppImage files were tested on the official pre-built GNU/Linux distribut
3126
- Ubuntu: `appimagecrafters/tests-env:ubuntu-bionic`
3227
- Centos: `appimagecrafters/tests-env:centos-7`
3328

34-
>Due to the limitation of AppImage technic itself, we only provide AppImage for Linux and Windows subsystem for linux (x86_64 platform) users.
29+
>Due to the limitation of AppImage technic itself, we only provide AppImage for Linux and Windows subsystem for Linux (x86_64 platform) users.
3530
Once you have installation issues and not familiar with docker,
3631
please download the AppImage file from our releases.
3732
>
@@ -52,8 +47,7 @@ chmod +x trackplot-${VERSION}-x86_64.AppImage
5247

5348
---
5449

55-
56-
### Docker
50+
3. using docker image
5751

5852
> Known issue: the logging time may have several hours mismatch with your local time, due to timezone settings inner the image.
5953
@@ -65,20 +59,12 @@ docker run --rm ygidtu/trackplot --help
6559
git clone https://github.com/ygidtu/trackplot trackplot
6660
cd trackplot
6761
docker build -t ygidtu/docker .
68-
69-
docker run --rm -v $PWD:$PWD --user $(id -u):$(id -g) ygidtu/trackplot --help
70-
62+
docker run --rm ygidtu/trackplot --help
7163
```
72-
- `-v`, `--volume`: mount the working directory to docker container
73-
- `--user`: prevent docker read and write file using root privileges
74-
- the rest usage please check [Command line usage](./command.md)
75-
76-
**Note: ** detailed command line usage please check [Command line Usage](./command.md)
77-
7864

7965
---
8066

81-
### Install from source
67+
4. install from source code
8268

8369
Prior to installing the tool from the source code, users should verify their Python version (>=3.8).
8470

@@ -87,9 +73,11 @@ python --version
8773
# Python 3.10.8
8874
```
8975

90-
#### python3 is not available
76+
4.1 python3 is not available
9177

92-
If your Python version does not match the requirements of Trackplot, users could follow the cmd to install and more detailed instruction for different system please refer to [here](https://realpython.com/installing-python/).
78+
If your Python version does not match the requirements of Trackplot,
79+
users could follow the cmd to install and
80+
more detailed instruction for different system please refer to [here](https://realpython.com/installing-python/).
9381

9482
```bash
9583
# If the default Python version does not meet the requirements of Trackplot,
@@ -117,7 +105,7 @@ $PWD/Python-3.10.12/Python-3.10.12/Python/bin/trackplot --help
117105

118106
```
119107

120-
#### python3 is available
108+
4.2 python3 is available
121109

122110
```bash
123111
# 1. download the trackplot
@@ -137,7 +125,7 @@ python main.py --help
137125

138126
---
139127

140-
### Conda
128+
5. install from bioconda
141129

142130
First make sure your conda is properly installed.
143131

@@ -173,7 +161,7 @@ trackplot --help
173161

174162
---
175163

176-
### for `pipenv` or `poetry` users
164+
6. for `pipenv` or `poetry` users
177165

178166
> Install [pipenv](https://pipenv.pypa.io/en/latest/) or [poetry](https://python-poetry.org)
179167
@@ -206,47 +194,50 @@ poetry shell && python main.py --help
206194
poetry run python main.py --help
207195
```
208196

209-
** Note: **
210-
If there is any problem with installation of `cairocffi`
211-
212-
- Please install the requirements according to the [Official Documentation of cairocffi](https://cairocffi.readthedocs.io/en/stable/overview.html)
213-
- Or try to use another backend, including `Agg`, `Pdf`, `Svg`, etc..., instead of `Cairo` by default.
214-
215-
But:
216-
- the `Agg`, `PDF`, etc. backends may have problems with the small protein domains, so use as appropriate.
217-
- ![](imgs/cmd/1.svg)
218-
219-
---
220-
### Build Web interface from source
197+
## Using trackplot by a local webserver
221198

222-
For this tutorial, we will assume that you have already installed Conda on your system.
199+
1. [AppImage](https://github.com/ygidtu/trackplot/releases) (Linux/WSL x86_64 only)
223200

224-
1.nodejs (18.14.0 LTS above)
201+
```bash
202+
# example with version v0.3.2, please using your interested version according to your needs
203+
export VERSION=0.3.2
204+
gunzip trackplot-${VERSION}-x86_64.AppImage
205+
chmod +x trackplot-${VERSION}-x86_64.AppImage
206+
./trackplot-${VERSION}-x86_64.AppImage --help
225207

226-
```shell
227-
# if conda is getting stuck at solving environment', please refer to https://stackoverflow.com/a/66963979
208+
# startup webserver
209+
./trackplot-${VERSION}-x86_64.AppImage --start-server --host 127.0.0.1 --port 5000 --plots ./plots
228210

229-
conda install -c conda-forge nodejs
230211
```
212+
213+
**Note:** the `--plots` were required while using appimages
231214

232-
Or user could download and install nodejs from [here](https://nodejs.org/en/).
233-
234-
2.install from source code
215+
---
235216

236-
Before this, please make sure that Trackplot has been properly installed in the same env.
217+
2. Running using command line
237218

219+
```bash
220+
trackplot --start-server --host 127.0.0.1 --port 5000 --plots ./plots
221+
```
238222

239-
```shell
240-
git clone https://github.com/ygidtu/trackplot trackplot
241-
cd trackplot/web
223+
---
242224

243-
# build the frontend static files; If npm was not found, please install nodejs(https://nodejs.org).
244-
npm install -g vue-cli vite && npm install
245-
vite build
225+
3. Install from a docker image
226+
227+
```bash
228+
docker pull ygidtu/trackplot
246229

247-
# check whether the ui is successfully compiled
248-
ls ../ui
230+
# Deploy the server
231+
docker run --name trackplot \
232+
--rm -v $PWD/example:/data -v $PWD/plots/:/plots -p 5000:5000 ygidtu/trackplot \
233+
--start-server \
234+
--host 0.0.0.0 \
235+
--data /data \
236+
--plots /plots
237+
238+
```
249239

250-
# then install trackplot from source code and start server as follow
251-
python main.py --start-server --host 127.0.0.1 --port 5000 --plots ./plots
252-
```
240+
`-p`: public and private port for the server, default:5000(public):5000(private)
241+
- `-v`, `--volume`: mount the working directory to docker container, for example, the `$PWD/data` could replace by the path to your directory contains all necessary data
242+
- `--user`: prevent docker read and write file using root privileges
243+
- the rest usage please check [Command line usage](./command.md)

0 commit comments

Comments
 (0)