Skip to main content

Command-line tool to make beautiful and reproducible genome browser snapshots

Project description

PyPI Version bioconda-badge bioconda-badge Build Status

pyGenomeTracks

Standalone program and library to plot beautiful genome browser tracks

pyGenomeTracks aims to produce high-quality genome browser tracks that are highly customizable. Currently, it is possible to plot:

  • bigwig
  • bed/gtf (many options)
  • bedgraph
  • epilogos
  • narrow peaks
  • links (represented as arcs)
  • Hi-C matrices

pyGenomeTracks can make plots with or without Hi-C data. The following is an example output of pyGenomeTracks from Ramírez et al. 2017

pyGenomeTracks example

Table of content

Installation

pyGenomeTracks works with python >=3.6.

Currently, the best way to install pyGenomeTracks is with anaconda

$ conda install -c bioconda -c conda-forge pygenometracks

Also, pyGenomeTracks can be installed using pip

$ pip install pyGenomeTracks

If the latest version wants to be installed use:

$ pip install  git+https://github.com/deeptools/pyGenomeTracks.git

Usage

To run pyGenomeTracks a configuration file describing the tracks is required. The easiest way to create this file is using the program make_tracks_file which creates a configuration file with defaults that can be easily changed. The format is:

$ make_tracks_file --trackFiles <file1.bed> <file2.bw> ... -o tracks.ini

make_tracks_file uses the file ending to guess the file type.

Then, a region can be plotted using:

$ pyGenomeTracks --tracks tracks.ini --region chr2:10,000,000-11,000,000 --outFileName nice_image.pdf

The ending --outFileName defines the image format. If .pdf is used, then the resulting image is a pdf. The options are pdf, png and svg.

Description of other possible arguments:

optional arguments:
  -h, --help            show this help message and exit
  --tracks TRACKS       File containing the instructions to plot the tracks.
                        The tracks.ini file can be genarated using the
                        `make_tracks_file` program.
  --region REGION       Region to plot, the format is chr:start-end
  --BED BED             Instead of a region, a file containing the regions to
                        plot, in BED format, can be given. If this is the
                        case, multiple files will be created using a prefix
                        the value of --outFileName
  --width WIDTH         figure width in centimeters
  --height HEIGHT       Figure height in centimeters. If not given, the figure
                        height is computed based on the heights of the tracks.
                        If given, the track height are proportionally scaled
                        to match the desired figure height.
  --title TITLE, -t TITLE
                        Plot title
  --outFileName OUTFILENAME, -out OUTFILENAME
                        File name to save the image, file prefix in case
                        multiple images are stored
  --fontSize FONTSIZE   Font size for the labels of the plot
  --dpi DPI             Resolution for the image in case the ouput is a raster
                        graphics image (e.g png, jpg)
  --trackLabelFraction TRACKLABELFRACTION
                        By default the space dedicated to the track labels is
                        0.05 of the plot width. This fraction can be changed
                        with this parameter if needed.
  --trackLabelHAlign {left,right,center}
                        By default, the horizontal alignment of the track
                        labels is left. This alignemnt can be changed to right
                        or center.
  --version             show program's version number and exit

Citation

If you use pyGenomeTracks in your analysis, you can cite the following paper :

Fidel Ramírez, Vivek Bhardwaj, Laura Arrigoni, Kin Chung Lam, Björn A. Grüning, José Villaveces, Bianca Habermann, Asifa Akhtar & Thomas Manke. High-resolution TADs reveal DNA sequences underlying genome organization in flies. Nature Communications (2018) doi:10.1038/s41467-017-02525-w

Documentation

Our documentation provide examples, as well as the full list of possible parameters and guidelines for developers who would like to add a new track type.

External users

  • CoolBox is an interactive genomic data explorer for Jupyter Notebooks
  • Galaxy integration offers a graphical user-interface to create PGT plots. It is also possible to include PGT into workflows and automatic pipelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyGenomeTracks-3.3.tar.gz (56.7 kB view details)

Uploaded Source

Built Distribution

pyGenomeTracks-3.3-py2.py3-none-any.whl (80.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyGenomeTracks-3.3.tar.gz.

File metadata

  • Download URL: pyGenomeTracks-3.3.tar.gz
  • Upload date:
  • Size: 56.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for pyGenomeTracks-3.3.tar.gz
Algorithm Hash digest
SHA256 0e30f56876983f72b971c0830d8ed692638877e004329f964b16136739508a9a
MD5 410e827e617ee8f3aac7746d33d4518d
BLAKE2b-256 79fe4a6e49d9404f772e4954d4f7091e885fcf800647a1521a64299d99bc931a

See more details on using hashes here.

Provenance

File details

Details for the file pyGenomeTracks-3.3-py2.py3-none-any.whl.

File metadata

  • Download URL: pyGenomeTracks-3.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1.post20200322 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for pyGenomeTracks-3.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 25779cbd2f50b761b190ec3af2bd6e2781e404bb9b1547ba3c8de691c9c62129
MD5 d4203289f45d05c876fc6fd2e2641c28
BLAKE2b-256 4176657f74964bf0b616f9f580fc9fe67cee925ba62873bd8e33171c758aaf0e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page