If you are working with chip-seq or atac-seq or any assays resulting in bigWig files, one of the common visualizations is to generate track plots displaying signal intensities across genomic loci. Libraries in R like Gviz facilitates such visualization but they are slow, complicated, and come with a large number of dependencies, not to mention R versions themselves.
Introducing trackplot - a fast and minimal dependency standalone R script to generate IGV style locus tracks from bigWig files in R.
trackplot has only two depdencies namely data.table R package, and bwtool CLI tool.
- Its fast since most of the heavy lifting is done by
- Plots are generated using pure base graphics (no ggplot2 or tidyverse dependencies)
- Automatically queries UCSC genome browser for gene models.
- Supports GTF and standard UCSC gene formats as well.
- Customization: Each track can be customized for color, scale, height/width.
- Region highlighting, gene track collapsing, etc
trackplot is a standalone R script and requires no installation. Just source it and you're good to go!
Source code on Github. Comments and suggestions are always welcome :)
# download and source the script > download.file(url = "https://raw.githubusercontent.com/PoisonAlien/trackplot/master/trackplot.R", destfile = "trackplot.R") > source('trackplot.R') > trackplot(bigWigs = c("CD34.bw", "EC.bw", "LC.bw", "CD4p.bw", "CD8p.bw"), loci = "chr3:187,715,903-187,752,003", draw_gene_track = TRUE, build = "hg38", mark_regions = markregions, custom_names = c("CD34", "EC", "LC", "CD4+", "CD8+") )
edit: Answering the comments, bwtool pre-built binaries are now included as part of the trackplot repository. Just make them executable and start using them.