Add a button for adding residue labels

m_button_add_res_labels(
  id,
  sel = m_sel(),
  style = m_style_label(),
  label = "Show Labels",
  byframe = FALSE,
  hideButton = TRUE,
  hideLabel = "Hide Labels"
)

Arguments

id

R3dmol id or a r3dmol object (the output from r3dmol()).

sel

Atom selection specification with m_sel()

style

Style spec to add to specified atoms created with m_style_label().

label

String for button label.

byframe

if TRUE, create labels for every individual frame in an animation, not just the current.

hideButton

Logical, whether to also create a button for removing all labels from the viewer.

hideLabel

String for hide labels button label.

Value

R3dmol id or a r3dmol object (the output from r3dmol())

Examples

# 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_res_labels(sel = m_sel(resi = c(70, 80, 90)))