Create and add model to viewer, given molecular data and its format. If
multi-model file is provided, use m_add_models
adding atom data
to the viewer as separate models.
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
Path of input data path or a vector of data.
Input format ('pdb'
, 'sdf'
, 'xyz'
,
'pqr'
, or 'mol2'
).
Default to FALSE, whether to keep or strip hydrogens from imported model.
Format dependent options. Attributes depend on the input file format.
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
library(r3dmol)
# Single-model file with m_add_model() function
r3dmol() %>%
m_add_model(data = pdb_6zsl, format = "pdb")
# Multi-model file with m_add_models() function
r3dmol() %>%
m_add_models(data = sdf_multiple, "sdf") %>%
m_zoom_to()
# Multi-model file with m_add_model() function
r3dmol() %>%
m_add_model(data = sdf_multiple, "sdf") %>%
m_zoom_to()
# Add model and keep hydrogens.
if (FALSE) {
r3dmol() %>%
m_add_model(m_fetch_pdb("5D8V"), keepH = TRUE) %>%
m_set_style(m_style_sphere()) %>%
m_zoom_to() %>%
m_spin()
}