m_multi_resi_sel: Selection Across Multiple Residues

Description Usage Arguments Details Value Examples

View source: R/sel.R

Description

Behaves just like the m_sel(), but returns a new selection for each residue specified with resi.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
m_multi_resi_sel(
  resi = NULL,
  resn = NULL,
  chain = NULL,
  model = NULL,
  elem = NULL,
  atom = NULL,
  invert = NULL,
  byres = NULL,
  b = NULL,
  expand = NULL,
  bonds = NULL,
  ss = NULL,
  clickable = NULL,
  callback = NULL
)

Arguments

resi

Residue number/s. (vector)

resn

Parent residue name as 3-letter code (e.g. "ALA", "GLY", "CYS"...)

chain

String, chain this atom belongs to (e.g. 'A' for chain A)

model

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).

elem

element abbreviation (e.g 'H', 'Ca', etc)

atom

Atom name, may be more specific than 'elem' (e.g. 'CA' for alpha carbon)

invert

Logical, if invert = TRUE, Inverts the selection criteria.

byres

Logical, if byres = TRUE, expands the selection to entire residues that include any selected atoms.

b

Atom b factor data

expand

Expand selection to include atoms within a specified distance from current selection. all atoms of any residue that has any atom already selected.

bonds

overloaded to select number of bonds, e.g. bonds = 0 will select all non-bonded atoms

ss

Secondary structure identifier. 'h' for helix, 's' for beta-sheet.

clickable

Set this flag to true to enable click selection handling for this atom

callback

Callback click handler function to be executed on this atom and its parent viewer.

Details

The m_sel(resi = 1:10) returns a selection of all 10 residues. The m_multi_resi_sel(resi = 1:10) returns 10 individual selections, each containing only 1 of the residues.

Value

sel list() for selecting atoms.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(r3dmol)

r3dmol() %>%
  m_add_model(data = pdb_6zsl) %>%
  m_set_style(style = m_style_cartoon()) %>%
  m_zoom_to() %>%
  m_add_style(
    sel = m_sel(resi = 1:10),
    style = c(
      m_style_stick(),
      m_style_sphere(scale = 0.3)
    )
  ) %>%
  m_add_line(
    start = m_multi_resi_sel(resi = rep(1, 9), chain = "A"),
    end = m_multi_resi_sel(
      resi = 2:10,
      chain = "B"
    )
  )

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