Skip to content
Back to search

trackplot

trackplot is a tool for visualizing various next-generation sequencing (NGS) data, including DNA-seq, RNA-seq, single-cell RNA-seq and full-length sequencing datasets.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ygidtu--trackplot/badge.svg)](/listings/ygidtu--trackplot)

HTML

<a href="/listings/ygidtu--trackplot"><img src="/api/listings/ygidtu--trackplot/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

pip install trackplot
trackplot --help

# or using trackplot by conda

conda create -n trackplot -c bioconda -c conda-forge trackplot
conda activate trackplot
trackplot --help

Notes

>1. For users on **Microsoft Windows**, **Mac (Apple Silicon)**, and **other ARM platforms**, please note that Trackplot may not be installable via PyPI or Conda due to compatibility issues with pysam, pybigwig, and hicmatrix libraries on these platforms. As an alternative, we recommend using the Docker image for installation.

>2. If you encounter a `segment fault` error during multiple processing, you may want to consider using the Docker image or running the command with the `-p 1` flag.

>3. If you encounter the message `Please install pyBigWig and hicmatrix`, you can refer to the official documentation for [pyBigWig](https://github.com/deeptools/pyBigWig) and [hicmatrix](https://github.com/deeptools/HiCMatrix) to fulfill their requirements and resolve the issue.

<details><summary>Using trackplot by a command line (click me) </summary> <p>

1. install from PyPi

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

pip install trackplot
# __Note:__ We noticed some pypi mirrors are not syncing some packages we depend on, 
# therefore please try another pypi mirror once you encounter 
# `No local packages or working download links found for xxx`

---

2. [AppBundle](https://github.com/xplshn/pelf) (Linux/WSL x86_64 platform only)

For a binary version of the tool and more comprehensive information, please visit [this link](./docs/installation.md).

# build the AppBundle from source (version auto-detected from pyproject.toml)
sh build-appbundle.sh

# the output filename and appbundle ID are printed at the end of the script
# package with pelf (see https://github.com/xplshn/pelf)
pelf \
    --add-appdir "./trackplot.AppDir" \
    --appbundle-id "$APPBUNDLE_ID" \
    --output-to "$OUTPUT_FILE"

chmod +x "$OUTPUT_FILE"
./"$OUTPUT_FILE" --help

---

3. using docker image

docker pull ygidtu/trackplot
docker run --rm ygidtu/trackplot --help

---

4. install from bioconda

# install trackplot into the default conda env 
conda install -c bioconda -c conda-forge trackplot

# or install trackplot into an isolated environments
conda create -n trackplot -c bioconda -c conda-forge trackplot

# activate the trackplot environment and execute the command line tool
conda activate trackplot
trackplot --help

</p> </details>

--- <details><summary>Using trackplot by a local webserver (click me) </summary> <p>

1. AppBundle (Linux/WSL x86_64 only)

Build the AppBundle following the [instructions above](#using-trackplot-by-a-command-line), then:

# OUTPUT_FILE is printed by build-appbundle.sh
chmod +x "$OUTPUT_FILE"
./"$OUTPUT_FILE" --help

# startup webserver
./"$OUTPUT_FILE" --start-server --host 0.0.0.0 --port 5000 --plots ./plots

**Note:** the `--plots` were required while using appbundles

---

2. Running using command line

trackplot --start-server --host 0.0.0.0 --port 5000 --plots ./plots

3. Running using docker image

docker pull ygidtu/trackplot

# Deploy the server
docker run --name trackplot \
  --rm -v $PWD/example:/data -v $PWD/plots/:/plots -p 5000:5000 ygidtu/trackplot \
  --start-server \
  --host 0.0.0.0 \
  --data /data \
  --plots /plots

`-p`: public and private port for the server, default:5000(public):5000(private) - `-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 - `--user`: prevent docker read and write file using root privileges

</p> </details>

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 303 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # trackplot
  2. [![PyPI version](https://badge.fury.io/py/trackplot.svg)](https://pypi.org/project/trackplot/)
  3. [![PyPI download](https://img.shields.io/pypi/dm/trackplot.svg)](https://pypi.org/project/trackplot/)
  4. [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](https://bioconda.github.io/recipes/trackplot/README.html)
  5. [![Documentation Status](https://readthedocs.org/projects/trackplot/badge/?version=latest)](https://trackplot.readthedocs.io/en/latest/)
  6. [![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
  7. [![DOI](https://img.shields.io/badge/DOI-10.1101%2F2022.11.02.514803%20-blue)](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011477)
  8. ---
  9. ![](example/diagram.png)
  10. [Tutorials](https://trackplot.readthedocs.io/en/latest/)
  11. ## What is trackplot
  12. Trackplot is a tool for visualizing various next-generation sequencing (NGS) data, including DNA-seq, RNA-seq, single-cell RNA-seq and full-length sequencing datasets.
  13. ### Features
  14. 1. Support various file formats as input
  15. 2. Support strand-aware coverage plot
  16. 3. Visualize coverage by heatmap, including HiC diagram
  17. 4. Visualize protein domain based the given gene id
  18. 5. Demultiplex the single-cell RNA/ATAC-seq which used cell barcode into cell population
  19. 6. Support visualizing individual full-length reads in read-by-read style
  20. 7. Support visualize circRNA sequencing data
  21. ## Input
  22. trackplot supports almost NGS data format, including
  23. - BAM
  24. - Bed
  25. - Depth file generated by `samtools depth`
  26. - bigBed [[pyBigWig](https://github.com/deeptools/pyBigWig) optional]
  27. - bigWig [[pyBigWig](https://github.com/deeptools/pyBigWig) optional]
  28. - naive Hi-C format [[hicmatrix](https://github.com/deeptools/HiCMatrix) optional]
  29. ## Output
  30. The output will be a pdf and other image file formats which satisfy the requirement of the major journals,
  31. and each track on output corresponds these datasets from config file.
  32. ## Usage
  33. Trackplot is based on **Python3** `(python_requires='>=3.8')`,
  34. and we have simplified the installation process on the main page.
  35. For a more comprehensive installation guide, please refer to [this link](./docs/installation.md).
  36. ### Quick start
  37. ```shell
  38. pip install trackplot
  39. trackplot --help
  40. # or using trackplot by conda
  41. conda create -n trackplot -c bioconda -c conda-forge trackplot
  42. conda activate trackplot
  43. trackplot --help
  44. ```
  45. ###### Notes
  46. >1. For users on **Microsoft Windows**, **Mac (Apple Silicon)**,
  47. and **other ARM platforms**,
  48. please note that Trackplot may not be installable via PyPI or Conda due to compatibility issues with pysam,
  49. pybigwig, and hicmatrix libraries on these platforms.
  50. As an alternative, we recommend using the Docker image for installation.
  51. >2. If you encounter a `segment fault` error during multiple processing,
  52. you may want to consider using the Docker image or running the command with the `-p 1` flag.
  53. >3. If you encounter the message `Please install pyBigWig and hicmatrix`,
  54. you can refer to the official documentation for [pyBigWig](https://github.com/deeptools/pyBigWig) and
  55. [hicmatrix](https://github.com/deeptools/HiCMatrix) to fulfill their requirements and resolve the issue.
  56. <details><summary>Using trackplot by a command line (click me) </summary>
  57. <p>
  58. 1. install from PyPi
  59. Before running this command line, please check python (>=3.8) was installed.
  60. ```bash
  61. pip install trackplot
  62. # __Note:__ We noticed some pypi mirrors are not syncing some packages we depend on,
  63. # therefore please try another pypi mirror once you encounter
  64. # `No local packages or working download links found for xxx`
  65. ```
  66. ---
  67. 2. [AppBundle](https://github.com/xplshn/pelf) (Linux/WSL x86_64 platform only)
  68. For a binary version of the tool and more comprehensive information, please visit [this link](./docs/installation.md).
  69. ```bash
  70. # build the AppBundle from source (version auto-detected from pyproject.toml)
  71. sh build-appbundle.sh
  72. # the output filename and appbundle ID are printed at the end of the script
  73. # package with pelf (see https://github.com/xplshn/pelf)
  74. pelf \
  75. --add-appdir "./trackplot.AppDir" \
  76. --appbundle-id "$APPBUNDLE_ID" \
  77. --output-to "$OUTPUT_FILE"
  78. chmod +x "$OUTPUT_FILE"
  79. ./"$OUTPUT_FILE" --help
  80. ```
  81. ---
  82. 3. using docker image
  83. ```bash
  84. docker pull ygidtu/trackplot
  85. docker run --rm ygidtu/trackplot --help
  86. ```
  87. ---
  88. 4. install from bioconda
  89. ```bash
  90. # install trackplot into the default conda env
  91. conda install -c bioconda -c conda-forge trackplot
  92. # or install trackplot into an isolated environments
  93. conda create -n trackplot -c bioconda -c conda-forge trackplot
  94. # activate the trackplot environment and execute the command line tool
  95. conda activate trackplot
  96. trackplot --help
  97. ```
  98. </p>
  99. </details>
  100. ---
  101. <details><summary>Using trackplot by a local webserver (click me) </summary>
  102. <p>
  103. 1. AppBundle (Linux/WSL x86_64 only)
  104. Build the AppBundle following the [instructions above](#using-trackplot-by-a-command-line), then:
  105. ```bash
  106. # OUTPUT_FILE is printed by build-appbundle.sh
  107. chmod +x "$OUTPUT_FILE"
  108. ./"$OUTPUT_FILE" --help
  109. # startup webserver
  110. ./"$OUTPUT_FILE" --start-server --host 0.0.0.0 --port 5000 --plots ./plots
  111. ```
  112. **Note:** the `--plots` were required while using appbundles
  113. ---
  114. 2. Running using command line
  115. ```bash
  116. trackplot --start-server --host 0.0.0.0 --port 5000 --plots ./plots
  117. ```
  118. 3. Running using docker image
  119. ```bash
  120. docker pull ygidtu/trackplot
  121. # Deploy the server
  122. docker run --name trackplot \
  123. --rm -v $PWD/example:/data -v $PWD/plots/:/plots -p 5000:5000 ygidtu/trackplot \
  124. --start-server \
  125. --host 0.0.0.0 \
  126. --data /data \
  127. --plots /plots
  128. ```
  129. `-p`: public and private port for the server, default:5000(public):5000(private)
  130. - `-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
  131. - `--user`: prevent docker read and write file using root privileges
  132. </p>
  133. </details>
  134. ---
  135. ## Example
  136. The `example` folder is downloaded from [here.](https://github.com/ygidtu/trackplot/archive/refs/heads/main.zip)
  137. And a more detailed tutorial could be found at [here.](https://trackplot.readthedocs.io/en/latest/)
  138. ```bash
  139. # example of basic plot types
  140. trackplot \
  141. -e chr1:1270656-1284730:+ \
  142. -r example/example.sorted.gtf.gz \
  143. --interval example/interval_list.tsv \
  144. --density example/density_list.tsv \
  145. --show-junction-num \
  146. --igv example/igv.tsv \
  147. --heatmap example/heatmap_list.tsv \
  148. --focus 1272656-1272656:1275656-1277656 \
  149. --stroke 1275656-1277656:1277856-1278656@blue \
  150. --sites 1271656,1271656,1272656 \
  151. --line example/line_list.tsv \
  152. -o example.png \
  153. --dpi 300 \
  154. --width 10 \
  155. --height 1 \
  156. --barcode example/barcode_list.tsv \
  157. --domain --remove-duplicate-umi \
  158. --normalize-format cpm \
  159. --annotation-scale .3 \
  160. -p 4
  161. ```
  162. If trackplot was installed via docker, here is the cmd:
  163. ```bash
  164. ## The absolute path is required in Docker env.
  165. cat $PWD/example/interval_list.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/interval_list.abspath.tsv
  166. cat $PWD/example/density_list.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/density_list.abspath.tsv
  167. cat $PWD/example/igv.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/igv.abspath.tsv
  168. cat $PWD/example/heatmap_list.tsv |grep -v '^#' | while read line; do echo $PWD/${line}; done > $PWD/example/heatmap_list.abspath.tsv
  169. docker run -v $PWD:$PWD -w $PWD --rm ygidtu/trackplot \
  170. -e chr1:1270656-1284730:+ \
  171. -r $PWD/example/example.sorted.gtf.gz \
  172. --interval $PWD/example/interval_list.tsv \
  173. --density $PWD/example/density_list.tsv \
  174. --show-junction-num \
  175. --igv $PWD/example/igv.tsv \
  176. --heatmap $PWD/example/heatmap_list.tsv \
  177. --focus 1272656-1272656:1275656-1277656 \
  178. --stroke 1275656-1277656:1277856-1278656@blue \
  179. --sites 1271656,1271656,1272656 \
  180. --line $PWD/example/line_list.tsv \
  181. -o example.png \
  182. --dpi 300 \
  183. --width 10 \
  184. --height 1 \
  185. --barcode $PWD/example/barcode_list.tsv \
  186. --domain --remove-duplicate-umi \
  187. --normalize-format cpm \
  188. --annotation-scale .3 \
  189. -p 4
  190. ```
  191. Here is the [output file](https://raw.githubusercontent.com/ygidtu/trackplot/main/example/example.png).
  192. ## For AI agents (auto-install the trackplot skill)
  193. This repo ships a ready-to-use **skill** that teaches an AI coding agent how to
  194. invoke trackplot. When an agent is asked to create a trackplot/sashimi figure,
  195. it should install this skill once (path relative to this file):
  196. ```bash
  197. # opencode / Claude Code style: point the skill manager at the bundled skill
  198. cp -r skills/trackplot ~/.config/opencode/skills/trackplot # or ~/.claude/skills/trackplot
  199. ```
  200. Then the agent reads `skills/trackplot/SKILL.md` (plus
  201. `skills/trackplot/references/config_files.md` and
  202. `skills/trackplot/references/python_api.md`) and follows it to:
  203. 1. Confirm the input region in `chr:start-end:strand` form and the annotation GTF.
  204. 2. Build the matching config TSV(s) for the requested track type(s) (see the
  205. `# filepath category label color` conventions).
  206. 3. Run `trackplot -e <region> -r <gtf> --density <list.tsv> -o <out>.pdf` (or the
  207. equivalent Python `Plot(...).set_region(...).add_density(...).plot(...)` chain).
  208. 4. Verify the output exists; if `pybigwig`/`hicmatrix` are needed for bigWig/HiC,
  209. install them first.
  210. The skill is the single source of truth for trackplot usage; keep it in sync with
  211. `docs/command.md` and `docs/interactive.md`.
  212. ## Questions
  213. Visit [issues](https://github.com/ygidtu/trackplot/issues) or
  214. contact [Yiming Zhang](https://github.com/ygidtu) or
  215. [Ran Zhou](https://github.com/zhou-ran)
  216. ## Citation
  217. If you use trackplot in your publication, please cite:
  218. Zhang Y, Zhou R, Liu L, et al. Trackplot: A flexible toolkit for combinatorial analysis of genomic data. *PLoS Computational Biology*, 2023, 19(9): e1011477.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.