Provides documentation for some basic useful selection criteria. For more advanced selection options, see the Official Documenation
m_sel(
model = NULL,
resi = NULL,
resn = NULL,
invert = NULL,
chain = NULL,
elem = NULL,
atom = NULL,
byres = NULL,
b = NULL,
expand = NULL,
bonds = NULL,
ss = NULL,
clickable = NULL,
callback = NULL
)
a single model or list of models from which atoms should be selected. Can also specify by numerical creation order. Reverse indexing is allowed (-1 specifies last added model).
Residue number/s. (vector)
Parent residue name as 3-letter code (e.g. "ALA", "GLY", "CYS"...)
Logical, if invert = TRUE
, Inverts the selection
criteria.
String, chain this atom belongs to (e.g. 'A' for chain A)
element abbreviation (e.g 'H', 'Ca', etc)
Atom name, may be more specific than 'elem' (e.g. 'CA' for alpha carbon)
Logical, if byres = TRUE
, expands the selection to
entire residues that include any selected atoms.
Atom b factor data
Expand selection to include atoms within a specified distance from current selection. all atoms of any residue that has any atom already selected.
overloaded to select number of bonds, e.g. bonds = 0
will select all non-bonded atoms
Secondary structure identifier. 'h' for helix, 's' for beta-sheet.
Set this flag to true to enable click selection handling for this atom
Callback click handler function to be executed on this atom and its parent viewer.
sel list()
for selecting atoms.
library(r3dmol)
if (FALSE) {
r3dmol() %>%
m_add_model(data = m_fetch_pdb("1bna")) %>%
m_add_style(
style = m_style_stick(),
sel = m_sel(resi = 1:2)
) %>%
m_zoom_to(sel = m_sel(resi = 1))
# Expand example
r3dmol() %>%
m_add_model(data = m_fetch_pdb("1bna")) %>%
m_add_style(
style = m_style_stick(),
sel = m_sel(
resi = 1,
expand = 10,
byres = TRUE
)
) %>%
m_zoom_to(sel = m_sel(resi = 1))
}