A Pin track can be created from a width-one GRanges that represents the genomic position and a numeric vector representing height of each "pin".
suppressPackageStartupMessages({ library(TnT) library(GenomicFeatures) }) set.seed(42)
Construct the data.
ir <- IRanges(start = c(10, 100, 1000), width = 1) gpos <- GRanges("chr12", ir) gpos$score <- c(0.1, 0.5, 1)
To construct the track and create the visualization.
ptrack <- TnT::PinTrack(gpos, value = gpos$score, domain = c(0, 1), color = c("yellow", "blue", "red")) TnTBoard(ptrack, GRanges("chr12", IRanges(1, 1200)))
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.