read.pdb(file, maxlines = -1, multi = FALSE, rm.insert = FALSE, rm.alt = TRUE, ATOM.only = FALSE, verbose = TRUE)
"print"(x, printseq=TRUE, ...)
"summary"(object, printseq=FALSE, ...)
read.pdb
. read.pdb
. pdbseq
. "pdb"
with the following components:
"xyz"
containing the
ATOM and HETATM coordinate data. nrow(atom)
with TRUE values indicating a C-alpha “elety”. "pdb"
. It can be used for building biological units
(See biounit
). maxlines
may be set so as to restrict the reading to a portion
of input files. Note that the preferred means of reading large
multi-model files is via binary DCD or NetCDF format trajectory files
(see the read.dcd
and read.ncdf
functions).
atom.select
, write.pdb
,
trim.pdb
, cat.pdb
,
read.prmtop
, as.pdb
,
read.dcd
, read.ncdf
,
read.fasta.pdb
, read.fasta
,
biounit
## Read a PDB file from the RCSB online database
#pdb <- read.pdb("4q21")
## Read a PDB file from those included with the package
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
## Print a brief composition summary
pdb
## Examine the storage format (or internal *str*ucture)
str(pdb)
## Print data for the first four atom
pdb$atom[1:4,]
## Print some coordinate data
head(pdb$atom[, c("x","y","z")])
## Or coordinates as a numeric vector
head(pdb$xyz)
## Print C-alpha coordinates (can also use 'atom.select' function)
head(pdb$atom[pdb$calpha, c("resid","elety","x","y","z")])
inds <- atom.select(pdb, elety="CA")
head( pdb$atom[inds$atom, ] )
## The atom.select() function returns 'indices' (row numbers)
## that can be used for accessing subsets of PDB objects, e.g.
inds <- atom.select(pdb,"ligand")
pdb$atom[inds$atom,]
pdb$xyz[inds$xyz]
## See the help page for atom.select() function for more details.
## Not run:
# ## Print SSE data for helix and sheet,
# ## see also dssp() and stride() functions
# print.sse(pdb)
# pdb$helix
# pdb$sheet$start
#
# ## Print SEQRES data
# pdb$seqres
#
# ## SEQRES as one letter code
# aa321(pdb$seqres)
#
# ## Where is the P-loop motif in the ATOM sequence
# inds.seq <- motif.find("G....GKT", pdbseq(pdb))
# pdbseq(pdb)[inds.seq]
#
# ## Where is it in the structure
# inds.pdb <- atom.select(pdb,resno=inds.seq, elety="CA")
# pdb$atom[inds.pdb$atom,]
# pdb$xyz[inds.pdb$xyz]
#
# ## View in interactive 3D mode
# #view(pdb)
# ## End(Not run)
Run the code above in your browser using DataLab