| xyz2torsion | R Documentation | 
Convert cartesian coordinate matrix to torsion angles with 
function torsion.pdb.
xyz2torsion(pdb, xyz, tbl = c("basic", "mainchain", 
     "sidechain", "all", "phi", "psi", paste("chi", 1:5, sep="")), ncore = NULL)
| pdb |  A PDB structure object as obtained from  | 
| xyz | Cartesian coordinates as a Mx(3N) matrix. | 
| tbl | Names of torsion angles to calculate. | 
| ncore | Number of CPU cores used to do the calculation. By default (NULL), use all detected CPU cores. | 
Available values for the argument ‘tbl’ include:
Basic: "phi", "psi", "chi1".
Mainchain: "phi", "psi".
Sidechain: "chi1", "chi2", "chi3", "chi4", "chi5".
All: all of the above.
Each individual angle.
Returns a MxP matrix, where M is the number of frames and P the number of valid torsion angles.
New function from the bio3d package, available at <https://github.com/Grantlab/bio3d/blob/master/new_funs/xyz2torsion.R>
Xin-Qiu Yao
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
torsion.xyz, torsion.pdb
  pdb <- system.file("rotamer/toy_coordinates.pdb", package= "Bios2cor")
  trj <- system.file("rotamer/toy_dynamics.dcd", package= "Bios2cor")
  
  pdb <- read.pdb(pdb)
  trj <- read.dcd(trj)
 
  #Selecting only "CA" atoms
  ca.inds <- atom.select(pdb, elety = "CA")
  #Getting xyz coordinates using fit.xyz form bio3d package
  xyz <- fit.xyz(fixed = pdb$xyz, mobile = trj,fixed.inds=ca.inds$xyz,mobile.inds=ca.inds$xyz)
 
  frames <- seq(from= 1, to= 40, by= 2)
  
  #Creating torsion object for side chains using xyz2torsion function from bio3d package
  tor <- xyz2torsion(pdb, xyz[frames,], tbl = "sidechain", ncore= 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.