if (FALSE) {
## Read a PDB file from the RCSB online database
pdb <- read.pdb("1bg2")
## Select calpha atoms
sele <- atom.select(pdb, "calpha")
## Trim PDB
new.pdb <- trim.pdb(pdb, inds=sele)
## Or, simply
#new.pdb <- trim.pdb(pdb, "calpha")
## Write to file
write.pdb(new.pdb, file="calpha.pdb")
}
Run the code above in your browser using DataLab