| TnT-shiny {TnT} | R Documentation |
Output and render functions for using TnT within Shiny applications and interactive Rmd documents.
TnTOutput(outputId, width = "100%", height = "auto") renderTnT(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height |
Must be a valid CSS unit (like |
expr |
An expression that generates a TnTBoard/TnTGenome object. |
env |
The environment in which to evaluate |
quoted |
Is |
An output or render function that enables the use of the converted htmlwidget within Shiny applications.
if (interactive() && require(shiny)) {
ui <- fluidPage(fluidRow(
column(width = 2, {
"A Simple Example Here"
}),
column(width = 10, {
TnTOutput("out")
})
))
server <- function (input, output) {
re.btrack <- reactive({
gr <- GRanges("chr12", IRanges(100, 1000))
BlockTrack(gr)
})
output$out <- renderTnT({
TnTBoard(re.btrack())
})
}
shinyApp(ui = ui, server = server)
}