Add lines between the given points. Will match starting point/s with ending point/s to create a line between each point. Styling options can be supplied as one option, or a vector of length equal to the number of lines.
m_add_line(
id,
start,
end,
dashed = TRUE,
color = "black",
opacity = 1,
hidden = FALSE
)
R3dmol id
or a r3dmol
object (the output from
r3dmol()
).
Starting position (or list()
of positions) of line. Can
be a single position or list()
of positions. Format either
m_sel()
or m_vector3()
.
Ending position (or list()
of positions) of line. Can
be a single position or list()
of positions. Format either
m_sel()
or m_vector3()
.
Logical whether the lines are dashed.
Either single or list of color values equal to number of lines.
Either single or list of opacity values equal to number of lines.
Either single or list of hidden values equal to number of lines.
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
library(r3dmol)
r3dmol() %>%
m_add_model(data = pdb_6zsl) %>%
m_set_style(style = m_style_cartoon()) %>%
m_zoom_to() %>%
m_add_style(
sel = m_sel(resi = 1:10),
style = c(
m_style_stick(),
m_style_sphere(scale = 0.3)
)
) %>%
m_add_line(
start = list(
m_sel(resi = 1, chain = "A"),
m_sel(resi = 1, chain = "A")
),
end = list(
m_sel(resi = 10, chain = "A"),
m_sel(resi = 10, chain = "B")
),
dashed = TRUE
)