# PDB server connection required - testing excluded
## Stucture of PKA:
pdb <- read.pdb("3dnd")
## Center of mass:
com(pdb)
## Center of mass of a selection
inds <- atom.select(pdb, chain="I")
com(pdb, inds)
## using XYZ Cartesian coordinates
xyz <- pdb$xyz[, inds$xyz]
com.xyz(xyz)
## with mass weighting
com.xyz(xyz, mass=atom2mass(pdb$atom[inds$atom, "elety"]) )
## Not run:
# ## Unknown atom names
# pdb <- read.pdb("3dnd")
# inds <- atom.select(pdb, resid="LL2")
# mycom <- com(pdb, inds, rescue=TRUE)
# #warnings()
#
#
# ## Map atom names manually
# pdb <- read.pdb("3RE0")
# inds <- atom.select(pdb, resno=201)
#
# myelety <- data.frame(name = c("CL2","PT1","N1","N2"), symb = c("Cl","Pt","N","N"))
# mymasses <- data.frame(symb = c("Cl","Pt"), mass = c(35.45, 195.08))
# mycom <- com(pdb, inds, elety.custom=myelety, mass.custom=mymasses)
# ## End(Not run)
Run the code above in your browser using DataLab