Learn R Programming

r3dmol (version 0.1.0)

m_add_style: Set or set style properties to all selected atoms

Description

Set or set style properties to all selected atoms

Usage

m_add_style(id, sel = list(), style = list())

m_set_style(id, sel = list(), style = list())

Arguments

id

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

sel

Atom selection specification

style

Style spec to apply to specified atoms

Value

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

Examples

Run this code
# NOT RUN {
library(r3dmol)

# Add style to model
r3dmol() %>%
  m_add_model(data = pdb_1j72, format = "pdb") %>%
  m_add_style(style = list(cartoon = list())) %>%
  m_zoom_to()

# Set style to model
r3dmol() %>%
  m_add_model(data = pdb_6zsl, format = "pdb") %>%
  m_set_style(style = list(cartoon = list())) %>%
  m_set_style(
    sel = list(chain = "A"),
    style = list(stick = list(
      radius = 0.5,
      colorscheme = "magentaCarbon"
    ))
  ) %>%
  m_zoom_to()
# }

Run the code above in your browser using DataLab