# Read PDB file
pdb <- read.pdb( "1bg2" )
# 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")
# Downlaod and align two PDB files
pdbs <- pdbaln( get.pdb( c( "4q21", "521p"), path=tempdir(), overwrite=TRUE))
# Get distance matrix
a <- dm(pdbs$xyz[1,])
b <- dm(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)")
Run the code above in your browser using DataLab