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"
)
Model to add to scene. Can be {bio3d}
pdb object or PDB
id code string (i.e "4ozs").
Given selection will additionally have 'ball-n-stick' representation. View will also zoom to selection.
Logical. FALSE will not zoom onto highlighted selection.
TRUE / FALSE will enable or disable spin. A numeric value will change spin speed and negative will reverse the direction.
Logical. Enables / disables mouse input.
Logical. Enables / disables ribbon representation.
Logical. Enables / disables black outline.
String of simple colour names or hex code to change background color of viewer.
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)
}