m_add_res_labels: Add Residue Labels

Description Usage Arguments Value Examples

View source: R/add.R

Description

Add residue labels. This will generate one label per a residue within the selected atoms. The label will be at the centroid of the atoms and styled according to the passed style. The label text will be resnresi

Usage

1
m_add_res_labels(id, sel = m_sel(), style = m_style_label(), byframe)

Arguments

id

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

sel

Atom selection specification

style

Style spec to add to specified atoms

byframe

if true, create labels for every individual frame, not just current

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(r3dmol)

r3dmol() %>%
  m_add_model(data = pdb_1j72, format = "pdb") %>%
  m_set_style(
    style = c(
      m_style_stick(radius = 0.15),
      m_style_cartoon()
    )
  ) %>%
  m_add_res_labels(
    sel = m_sel(resn = "GLY"),
    style = m_style_label(
      font = "Arial",
      fontColor = "white",
      backgroundColor = "black",
      showBackground = TRUE
    )
  ) %>%
  m_zoom_to()

r3dmol documentation built on March 14, 2021, 5:08 p.m.