Learn R Programming

r3dmol (version 0.1.0)

m_add_model: Create and add model to viewer

Description

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.

Usage

m_add_model(
  id,
  data,
  format = c("pdb", "sdf", "xyz", "pqr", "mol2", "cif"),
  options
)

m_add_models(id, data, format = c("pdb", "sdf", "xyz", "pqr", "mol2", "cif"))

Arguments

id

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

data

Path of input data path or a vector of data.

format

Input format ('pdb', 'sdf', 'xyz', 'pqr', or 'mol2').

options

Format dependent options. Attributes depend on the input file format.

Value

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

Examples

Run this code
# NOT RUN {
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()
# }

Run the code above in your browser using DataLab