Add a button for adding a surface
m_button_add_surface(
id,
label = "Surface",
type = "VDW",
style = m_style_surface(),
atomsel = m_sel(),
allsel = NULL,
removeSurface = TRUE,
removeLabel = "Clear Surfaces"
)
R3dmol id
or a r3dmol
object (the output from
r3dmol()
).
String for button label.
Surface type ('VDW', 'MS', 'SAS', or 'SES')
Optional style specification for surface material created with m_style_surface()
to alter color and opacity.
Show surface for atoms in this selection.
Use different atoms to calculate the surface than to display
it. May be a larger selection than atomsel
.
Logical, whether to also create a button that will remove all surfaces from the viewer.
String for clear surface button label.
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
# Add buttons to add and clear surface representations
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_zoom_to() %>%
m_set_style(m_style_cartoon()) %>%
m_button_add_surface(
style = m_style_surface(opacity = 0.4),
atomsel = m_sel(resi = 70:110)
) %>%
m_button_add_surface(
style = m_style_surface(opacity = 1),
atomsel = m_sel(resi = 70:110, invert = TRUE),
label = "Rest of Protein",
removeSurface = FALSE
)