This is the low-level util to create visualizations.
expose_all <- function (package) { attachname <- paste0(package, "_all") while (attachname %in% search()) detach(attachname, character.only = TRUE) pkgns <- loadNamespace(package) attach(pkgns, name = attachname) invisible(pkgns) } suppressMessages(expose_all("TnT"))
trackWidget(' var axisTrack = tnt.board.track() .height(20) .color("white") .display(tnt.board.track.feature.axis()); var blockTrack = tnt.board.track() .height(30) .color("grey") .data(tnt.board.track.data.sync() .retriever(function () { return [ {start: 200, end: 350}, {start: 400, end: 450} ] }) ) .display( tnt.board.track.feature.block() .color("red") ); var board = tnt.board() .from(100) .to(500) .min(0) .max(1000) .add_track(axisTrack) .add_track(blockTrack); board ')
axisTrack <- jc( tnt.board.track = ma(), height = 20, color = "white", display = jc(tnt.board.track.feature.axis = ma()) ) blockTrack <- jc( tnt.board.track = ma(), height = 30, color = "green", data = jc( tnt.board.track.data.sync = ma(), retriever = js("function() { return [ {start: 200, end: 350}, {start: 550, end: 770} ]; }") ), display = jc( tnt.board.track.feature.block = ma(), color = "red", index = js("function (d) {return d.start}") ) ) tntdef <- jc( tnt.board = ma(), from = 0, to = 500, min = 0, max = 1000, add_track = axisTrack, add_track = blockTrack ) asJS(tntdef) trackWidget(tntdef)
genome <- jc( tnt.board.genome = ma(), species = "human", chr = 10, from = 410000, to = 420000, min_coord = js("new Promise(function (res) {res(-10000)})"), max_coord = js("new Promise(function (res) {res(420000)})") ) trackWidget(genome)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.