Learn R Programming

⚠️There's a newer version (0.1.2) of this package.Take me there.

r3dmol

This is an R package that provides support for 3Dmol.js as a htmlwidgets.

Installation

This package is still very early in its development stages, everything will be changed very often! Please give me a star on Github if you find it useful and I will speed up the development process!

You can install the released version of r3dmol from CRAN with:

# Not available now.
# install.packages("r3dmol")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("swsoyee/r3dmol")

Example

library(r3dmol)
r3dmol() %>%
  m_add_model(data = pdb_6zsl, format = "pdb") %>%
  m_zoom_to() %>%
  m_set_style(style = list(cartoon = list(color = 'spectrum')))

About 3Dmol.js

Nicholas Rego and David Koes 3Dmol.js: molecular visualization with WebGL Bioinformatics (2015) 31 (8): 1322-1324 doi:10.1093/bioinformatics/btu829

Copy Link

Version

Install

install.packages('r3dmol')

Monthly Downloads

351

Version

0.1.0

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Wei Su

Last Published

October 26th, 2020

Functions in r3dmol (0.1.0)

m_add_arrow

Create and add shape
m_add_as_one_molecule

Create and add model to viewer
m_add_custom

Add custom shape component from user supplied function
m_add_label

Add label to viewer
m_add_model

Create and add model to viewer
cube_benzene_homo

Gaussian cube file example
m_enable_fog

Enable/disable fog for content far from the camera
m_add_res_labels

Add residue labels
m_add_property_labels

Add property labels
m_get_model

Return specified model
init

Initialise a WebGL-based viewer
m_remove_all_models

Delete all existing models
m_set_slab

Set slab of view
m_set_projection

Set view projection scheme
m_render

Render current state of viewer
m_rotate

Rotate scene by angle degrees around axis
m_spin

Continuously rotate a scene around the specified axis
m_create_model_from

Create a new model from atoms specified by sel
m_remove_all_shapes

Remove all shape objects from viewer
m_clear

Clear scene of all objects
m_remove_all_surfaces

Remove all labels from viewer
m_animate

Animate all models in viewer from their respective frames
m_center

Re-center the viewer around the provided selection
m_stop_animate

Stop animation of all models in viewer
m_zoom_to

Zoom to center of atom selection
pdb_1j72

Crystal Structure of Mutant Macrophage Capping Protein (Cap G) with Actin-severing Activity in the Ca2+-Free Form in PDB format
m_set_zoom_limits

Set lower and upper limit stops for zoom
m_shiny_demo

Run examples of using r3dmol in a Shiny app
m_remove_label

Remove label from viewer
m_set_preceived_distance

Set the distance between the model and the camera
m_set_hover_duration

Set the duration of the hover delay
m_add_unit_cell

Unit cell visualization
m_is_animated

Get viewer animate status
m_zoom

Zoom current view by a constant factor
m_vibrate

Add model's vibration
m_add_shape

Add shape object to viewer
r3dmol-shiny

Shiny bindings for r3dmol
m_add_surface

Add surface representation to atoms
pdb_6zsl

Crystal structure of the SARS-CoV-2 helicase at 1.94 Angstrom resolution in PDB format
m_set_default_cartoon_quality

Set the default cartoon quality for newly created models
m_set_color_by_element

Set color by element
m_vector3

Create a 3 dimensional vector
m_remove_all_labels

Remove all labels from viewer
m_set_view

Sets the view to the specified translation, zoom, rotation and style
reexports

Objects exported from other packages
sdf_multiple

Multiple sdf file example
xyz_multiple

Multiple xyz file example
m_set_viewer

Set viewer properties
m_add_style

Set or set style properties to all selected atoms
m_translate

Translate current view or models by x,y screen coordinates
m_add_models_as_frames

Create and add model to viewer
m_add_isosurface

Construct isosurface from volumetric data in gaussian cube format
cif_254385

Cif file example