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.
Features:
- Its fast since most of the heavy lifting is done by
bwtool - 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
Usage:
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.
0 answers
No answers yet.
Log in to answer this question.
Try these instructions for bwtool compilation. It should work. Copied below as well.
Yes, I tried that already. Fine for CentOS, but on macOS 10.14 I keep getting errors, please see this link for the make errors. I can also open a separate issue over at libbeato if you like.
I have tested quite throroughly on Ubuntu and CentOS. It works with no issues. Also, I do have a compiled version of bwtool on my mac (10.15.2), and I could not reproduce your errors. I guess opening an issue on
libbeatomight help to speed up debugging. edit: I am happy to share the bwtool mac binary if you would like.Thanks, I could compile it on another Mac I had around, took the binary from there and now it works fine. Here is the binary if anyone wants to use it. Maybe you want to put a binary for both Linux and macOS on the Git of your tool so users can use it directly.
Tried
trackplotin the meantime, awesomely fast and easy, thank you for creating it. Have been looking for something that is more intuitive than gviz for quite some time, this is very promising.Thanks for testing and I am glad that you were able to make it work. I will make available the binaries soon :) edit: centOS and macOS binaries for bwtool are included in the repository. Thanks for the suggestion.
Bundling the binaries together in one tar may prove confusing to novice users. Perhaps you can consider making them available independently and linking them in the text when you mention their availability independently.
There is a typo in the binary README's, it is currently
chmod +Xrather than+xto make them executable.Thanks, @genomax and @ATpoint I have updated the repository.
Hi I tried your script to make the plots but got an error
The bwtool installed using the same lines above.
R session
Did you add it to
PATHor to a folder inPATH?I just added it to PATH. Still I get the same error.
Problem solved using:
You are almost there. You just need to copy/move the binary to a
PATH(e.g;/usr/local/bin) or to a directory underPATH.Getting this error on MacOS 10.14.6
Any idea whats going on? Also seems like others are running into the same problem ( https://github.com/CRG-Barcelona/libbeato/issues/9 ). A solution will be appreciated.