Plot genome track data
Project description
gtracks
Plot genome track data from bigWig files. Powered by pyGenomeTracks.
Installation
pip3 install gtracks
or
pip3 install --user gtracks
Examples
An example bigwig file with ATAC-seq data from the insulin region is included. You can generate a test plot like this:
gtracks INS-IGF2 test.png
You can plot your own tracks over other genomic regions by providing more positional arguments: a region or gene name and paths to one or more bigWig files. The file type of the plot will be determined by the output file extension.
gtracks chr11:2150341-2182439 track1.bw track2.bw output.pdf
gtracks INS track1.bw track2.bw output.svg
Modifying the gene annotations track
GRCh37/hg19 gene annotations are used by default, but you can plot GRCh38/hg38
genes by adding --genes GRCh38 or --genes hg38. You can use your own gene
annotations file (BED or BED12 format) by providing
--genes <path/to/genes.bed.gz>.
You may want to add more rows to the genes track. You can do this using
the --genes-height and --gene-rows options.
gtracks INS test-genes.png --genes-height 6 --gene-rows 6
Changing the color palette
You can change the color palette for bigWig tracks using the --color-palette option.
gtracks INS track1.bw track2.bw track3.bw output.pdf --color-palette "#color1" "#color2" "#color3"
Setting y-axis height
By default, tracks have different y-axis heights depending on signal height.
You can set a uniform y-axis height for all tracks using the --max option.
gtracks INS track1.bw track2.bw track3.bw output.pdf --max 400
For more command-line options, see the usage page below.
Environment variables
If you want to use your own bigWig files but don't want to write out their
paths every time you run gtracks, you can set your own default tracks using
the environment variable GTRACKS_TRACKS.
export GTRACKS_TRACKS=track1.bw,track2.bw,track3.bw
gtracks output.pdf
You can also change the default gene annotations file and color palette using
environment variables GTRACKS_GENES_PATH and GTRACKS_COLOR_PALETTE.
export GTRACKS_GENES_PATH=path/to/genes.bed.gz
export GTRACKS_COLOR_PALETTE="#color1,#color2,#color3"
gtracks output.pdf
Usage
usage: gtracks [-h] [--genes <{path/to/genes.bed.gz,GRCh37,GRCh38,hg19,hg38}>]
[--color-palette <#color> [<#color> ...]] [--max <float>]
[--tmp-dir <temp/file/dir>] [--width <int>]
[--genes-height <int>] [--gene-rows <int>]
<{chr:start-end,GENE}> [<track.bw> [<track.bw> ...]]
<path/to/output.{pdf,png,svg}>
Plot bigWig signal tracks and gene annotations in a genomic region
positional arguments:
<{chr:start-end,GENE}>
coordinates or gene name to plot
<track.bw> bigWig files containing tracks
<path/to/output.{pdf,png,svg}>
path to output file
optional arguments:
-h, --help show this help message and exit
--genes <{path/to/genes.bed.gz,GRCh37,GRCh38,hg19,hg38}>
compressed 6-column BED file or 12-column BED12 file
containing gene annotations. Alternatively, providing
a genome identifier will use one of the included gene
tracks. (default: GRCh37)
--color-palette <#color> [<#color> ...]
color pallete for tracks
--max <float> max value of y-axis
--tmp-dir <temp/file/dir>
directory for temporary files
--width <int> width of plot in cm (default: 40)
--genes-height <int> height of genes track (default: 2)
--gene-rows <int> number of gene rows (default: 1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gtracks-1.2.0.tar.gz.
File metadata
- Download URL: gtracks-1.2.0.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd0a4231e218ff88b676222851c702de6c5dd9f2bd8a26f3624adf40bf0f9568
|
|
| MD5 |
71d35447f7cae61a7849e7e4c55cc827
|
|
| BLAKE2b-256 |
0fe4d99a8623df84385dae0ba4264d037b2b35c483beb5571bb9dc49e251c555
|
File details
Details for the file gtracks-1.2.0-py3-none-any.whl.
File metadata
- Download URL: gtracks-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d63fdac4f948f84c714808c77e4b2698e736503d4a30e6a6be5b2b03249a495f
|
|
| MD5 |
7dc491b224b6485b98d8e3bdd26cdebc
|
|
| BLAKE2b-256 |
716acc5ec68ce00d351890ca992bb50979d8d085dc6f26a4a9765c3639a6a8b4
|