m_glimpse {r3dmol}R Documentation

Quickly View Given Structure

Description

Creates a scene with a number of simple defaults in order to quickly view the structure without having to write multiple lines of code.

Usage

m_glimpse(
  model,
  highlight = m_sel(),
  zoom = TRUE,
  spin = FALSE,
  nomouse = FALSE,
  ribbon = FALSE,
  outline = TRUE,
  backgroundColor = "white"
)

Arguments

model

Model to add to scene. Can be {bio3d} pdb object or PDB id code string (i.e "4ozs").

highlight

Given selection will additionally have 'ball-n-stick' representation. View will also zoom to selection.

zoom

Logical. FALSE will not zoom onto highlighted selection.

spin

TRUE / FALSE will enable or disable spin. A numeric value will change spin speed and negative will reverse the direction.

nomouse

Logical. Enables / disables mouse input.

ribbon

Logical. Enables / disables ribbon representation.

outline

Logical. Enables / disables black outline.

backgroundColor

String of simple colour names or hex code to change background color of viewer.

Examples

library(r3dmol)

# write/read demo structure as {bio3d} object
tmp <- tempfile()
write(pdb_6zsl, tmp)
pdb <- bio3d::read.pdb(tmp)

# quickly preview structure
pdb %>%
  m_glimpse()

# preview structure, highlighting particular region.
pdb %>%
  m_glimpse(m_sel(resi = 1:10, chain = "A"), spin = 0.2)
## Not run: 

# Fetch given PDB string and quickly preview structure
"4ozs" %>%
  m_glimpse(spin = TRUE)

## End(Not run)

[Package r3dmol version 0.1.2 Index]