Skip to contents

Quick interactive multi-structure ensemble bio3d pdbs object viewing using the NGLVieweR package.

Usage

view.pdbs(
  pdbs,
  cols = NULL,
  colorScheme = NULL,
  representation = "cartoon",
  backgroundColor = "white"
)

Arguments

pdbs

a multi-structure pdbs object as obtained from pdbaln(), read.fasta.pdb(), etc.

cols

a vector of colors, typically one entry per structure. If NULL then the output of vmd.colors() is used.

colorScheme

if not NULL then this over-rides the previous cols input argument. Possible values include "residueindex", "modelindex", "sstruc", "bfactor", "chainid", "chainindex", "atomindex", "occupancy"

representation

the representation style, useful values are line, tube, cartoon, trace, and backbone, ball+stick.

backgroundColor

set the display area background color.

Value

an NGLVieweR display object that can be displayed or further added to using NGLVieweR::addRepresentation() and friends.

Details

Just like the related view.pdb() function the objective here is to speed up the inspection of multi structure ensembles without having to write out many aligned and superposed individual PDB files for viewing in a external molecular viewer (like PyMol, Mol-star, or VMD - all of which are excellent but often overkill for a quick inspection) or write many lines of NGLVieweR code that loop through all structures in a given pdbs object.

Author

Barry Grant, bjgrant@ucsd.edu

Examples

  #pth <- "~/Desktop/courses/BIMM143/class10/pdbs/split_chain/"
  #files <- list.files(path=pth, full.names = TRUE)
  #pdbs <- bio3d::pdbaln(files, fit=TRUE, exefile="msa")

 data(transducin, package="bio3d")
 attach(transducin)
#> The following objects are masked from transducin (pos = 3):
#> 
#>     annotation, core, pdbs
#> The following objects are masked from transducin (pos = 8):
#> 
#>     annotation, core, pdbs
#> The following objects are masked from transducin (pos = 9):
#> 
#>     annotation, core, pdbs

 view.pdbs(pdbs)
#> Warning: Colors will be recycled: input 'n' > 33
view.pdbs(pdbs, representation = "cartoon") #> Warning: Colors will be recycled: input 'n' > 33
# Trace, tube, line, cartoon, ball+stick view.pdbs(pdbs, representation = "trace") #> Warning: Colors will be recycled: input 'n' > 33
view.pdbs(pdbs, cols = c("red","blue") ) #> Warning: Not enough distinct cols for each structure, recycling
# Perhaps this should be the default? view.pdbs(pdbs, colorScheme = "residueindex")