# NOT RUN {
##- PDB example
# Read a PDB file
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
# Select protein atoms of chain A
atom.select(pdb, "protein", chain="A")
# Select all atoms except from the protein
atom.select(pdb, "protein", inverse=TRUE, verbose=TRUE)
# Select all C-alpha atoms with residues numbers between 43 and 54
sele <- atom.select(pdb, "calpha", resno=43:54, verbose=TRUE)
# Access the PDB data with the selection indices
print( pdb$atom[ sele$atom, "resid" ] )
print( pdb$xyz[ sele$xyz ] )
# Trim PDB to selection
ca.pdb <- trim.pdb(pdb, sele)
# }
# NOT RUN {
##- PRMTOP example
prmtop <- read.prmtop(system.file("examples/crambin.prmtop", package="bio3d"))
## Atom selection
ca.inds <- atom.select(prmtop, "calpha")
# }
Run the code above in your browser using DataLab