xyz2torsion: Convert Cartesian Coordinates to Torsion Angles

xyz2torsionR Documentation

Convert Cartesian Coordinates to Torsion Angles

Description

Convert cartesian coordinate matrix to torsion angles with function torsion.pdb.

Usage

xyz2torsion(pdb, xyz, tbl = c("basic", "mainchain", 
     "sidechain", "all", "phi", "psi", paste("chi", 1:5, sep="")), ncore = NULL)

Arguments

pdb

A PDB structure object as obtained from read.pdb.

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.

Details

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.

Value

Returns a MxP matrix, where M is the number of frames and P the number of valid torsion angles.

Note

New function from the bio3d package, available at <https://github.com/Grantlab/bio3d/blob/master/new_funs/xyz2torsion.R>

Author(s)

Xin-Qiu Yao

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.

See Also

torsion.xyz, torsion.pdb

Examples

  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)

Bios2cor documentation built on July 8, 2022, 5:05 p.m.