selectionParameters | R Documentation |
Set selection parameters.
selectionParameters(NGLVieweR, proximity = 3, level = "residue")
NGLVieweR |
A NGLVieweR object. |
proximity |
Set distance in angstrom for atoms to return in proximity of
selection. Default = |
level |
Set level on which atoms in proximity of selection are returned. Options are "residue" (default) or atom". |
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.