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

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)
#>    PDB has ALT records, taking A only, rm.alt=TRUE

# quickly preview structure
pdb %>%
  m_glimpse()
# preview structure, highlighting particular region. pdb %>% m_glimpse(m_sel(resi = 1:10, chain = "A"), spin = 0.2)
if (FALSE) { # Fetch given PDB string and quickly preview structure "4ozs" %>% m_glimpse(spin = TRUE) }