Function to take a bio3d pdb
structure object and convert it to a single
element character vector that can then be used as input for the NGLVieweR
and r3dmol packages.
Arguments
- pdb
a bio3d pdb object as obtained from
read.pdb()
.- ...
Extra arguments that are passed to
write.pdb()
.
Value
a single element character vector with return characters as required
by NGLVieweR::NGLVieweR()
function with format=pdb
option. Note that
no intermediate files are produced.
See also
view.pdb()
which uses this function internally, NGLVieweR::NGLVieweR()
, bio3d::read.pdb()
.
Author
Barry Grant, bjgrant@ucsd.edu
Examples
pdb <- bio3d::read.pdb("5p21")
#> Note: Accessing on-line PDB file
#> Warning: /var/folders/jd/wjwf0lcj0kd0tch_70sd1l4w0000gn/T//RtmpEoJQ6k/5p21.pdb exists. Skipping download
NGLVieweR::NGLVieweR(pdb2string(pdb), format="pdb") |>
NGLVieweR::addRepresentation("cartoon")
# Or more simply
view.pdb(pdb)