"plot"(x, key = TRUE, resnum.1 = c(1:ncol(x)), resnum.2 = resnum.1, axis.tick.space = 20, zlim = range(x, finite = TRUE), nlevels = 20, levels = pretty(zlim, nlevels), color.palette = bwr.colors, col = color.palette(length(levels) - 1), axes = TRUE, key.axes, xaxs = "i", yaxs = "i", las = 1, grid = TRUE, grid.col = "yellow", grid.nx = floor(ncol(x)/30), grid.ny = grid.nx, center.zero = TRUE, flip=TRUE, ...)
dm
. levels
is not specified, the range of 'z' values
is divided into approximately this many levels. Plot a distance matrix (DM) or a difference distance matrix (DDM).
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.T
Much of this function is based on the filled.contour
function
by Ross Ihaka.
This function is based on the layout
and legend key code in the
function filled.contour
by Ross Ihaka. As with
filled.contour
the output is a combination of two plots: the
legend and (in this case) image
(rather than a contour plot).
# Read PDB file pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") ) # DM d <- dm(pdb,"calpha") # Plot DM ##filled.contour(d, nlevels = 4) ##plot(d) plot(d, resnum.1 = pdb$atom[pdb$calpha,"resno"], color.palette = mono.colors, xlab="Residue Number", ylab="Residue Number") # Download and align two PDB files pdbs <- pdbaln( get.pdb( c( "4q21", "521p"), path=tempdir(), overwrite=TRUE))Reading PDB files: /tmp/RtmpTDihxb/4q21.pdb /tmp/RtmpTDihxb/521p.pdb .. Extracting sequences pdb/seq: 1 name: /tmp/RtmpTDihxb/4q21.pdb pdb/seq: 2 name: /tmp/RtmpTDihxb/521p.pdb# Get distance matrix a <- dm.xyz(pdbs$xyz[1,]) b <- dm.xyz(pdbs$xyz[2,]) # Calculate DDM c <- a - b # Plot DDM plot(c,key=FALSE, grid=FALSE)plot(c, axis.tick.space=10, resnum.1=pdbs$resno[1,], resnum.2=pdbs$resno[2,], grid.col="black", xlab="Residue No. (4q21)", ylab="Residue No. (521p)")