Skip to content

style 2 protein models with different colors #55

Answered by swsoyee
lee-t asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, you could try m_sel() to color them by the model index.

library(bio3d)
library(r3dmol)

# read two G-protein structures
a <- read.pdb("4q21")
b <- read.pdb("4lhy")

r3dmol() %>%
  m_add_model(data = m_bio3d(a)) %>%
  m_set_style(
    sel = m_sel(model = 0),
    style = m_style_cartoon(
      color = "aquamarine"
    )) %>%
  m_add_model(data =  m_bio3d(b)) %>%
  m_set_style(
    sel = m_sel(model = 1),
    style = m_style_cartoon(
      color = "orange"
    )) %>%
  m_zoom_to() 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lee-t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants