pdb <- read.pdb("1bg2")
crdfile <- tempfile()
write.crd(pdb, file=crdfile)
crd <- read.crd(crdfile)
ca.inds <- which(crd$calpha)
crd$atom[ca.inds[1:20],c("x","y","z")]
# write.pdb(crd, file=tempfile())
Run the code above in your browser using DataLab