rgyr(xyz, mass=NULL, ncore=1, nseg.scale=1)
xyz
component, containing one or more coordinate sets.mass==NULL
, all atoms are assumed carbon.ncore>1
requires package parallel installed. fit.xyz
. Calculate the radius of gyration of coordinate sets.
Radius of gyration is a standard measure of overall structural change of macromolecules.
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.
# PDB server connection required - testing excluded # -- Calculate Rog of single structure pdb <- read.pdb("1bg2")Note: Accessing on-line PDB filemass <- rep(12, length(pdb$xyz)/3) mass[substr(pdb$atom[,"elety"], 1, 1) == "N"] <- 14 mass[substr(pdb$atom[,"elety"], 1, 1) == "H"] <- 1 mass[substr(pdb$atom[,"elety"], 1, 1) == "O"] <- 16 mass[substr(pdb$atom[,"elety"], 1, 1) == "S"] <- 32 rgyr(pdb, mass)[1] 19.8667# -- Calculate Rog of a trajectory xyz <- read.dcd(system.file("examples/hivp.dcd", package="bio3d"))NATOM = 198 NFRAME= 117 ISTART= 0 last = 117 nstep = 117 nfile = 117 NSAVE = 1 NDEGF = 0 version 24 Reading (x100) |======================================================================| 100%rg <- rgyr(xyz) rg[1:10][1] 17.50097 17.38617 17.45981 17.40144 17.32908 17.37739 17.46936 17.62601 [9] 17.45649 17.47451