Set selection parameters.
selectionParameters(NGLVieweR, proximity = 3, level = "residue")
Returns list of selection parameters to NGLVieweR
htmlwidgets
object.
NGLVieweR("7CID") %>%
addRepresentation("cartoon") %>%
selectionParameters(3, "residue")
# Shiny context
if (interactive()) {
library(shiny)
ui <- fluidPage(NGLVieweROutput("structure"))
server <- function(input, output) {
output$structure <- renderNGLVieweR({
NGLVieweR("7CID") %>%
addRepresentation("cartoon") %>%
selectionParameters(3, "residue")
})
observeEvent(input$structure_selAround, {
NGLVieweR_proxy("structure") %>% removeSelection("selAround")
NGLVieweR_proxy("structure") %>%
addSelection(
"ball+stick",
param =
list(
name = "selAround",
sele = input$structure_selAround,
colorValue = "grey"
)
)
})
}
shinyApp(ui, server)
}