m_glimpse: Quickly View Given Structure

Description Usage Arguments Examples

View source: R/glimpse.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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)

r3dmol documentation built on March 14, 2021, 5:08 p.m.