TnT-shiny {TnT}R Documentation

Shiny bindings for TnT

Description

Output and render functions for using TnT within Shiny applications and interactive Rmd documents.

Usage

TnTOutput(outputId, width = "100%", height = "auto")

renderTnT(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a TnTBoard/TnTGenome object.

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Value

An output or render function that enables the use of the converted htmlwidget within Shiny applications.

Examples

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)
}

[Package TnT version 1.2.0 Index]