data(kinesin)
attach(kinesin, warn.conflicts=FALSE)
# Ignore gap containing positions
##gaps.res <- gap.inspect(pdbs$ali)
gaps.pos <- gap.inspect(pdbs$xyz)
#-- Do PCA
pc.xray <- pca.xyz(pdbs$xyz[, gaps.pos$f.inds])
# Define a difference vector between two structural states
diff.inds <- c(grep("d1v8ja", pdbs$id),
grep("d1goja", pdbs$id))
dv <- difference.vector( pdbs$xyz[diff.inds,], gaps.pos$f.inds )
# Calculate the squared overlap between the PCs and the difference vector
o <- overlap(pc.xray, dv)
o <- overlap(pc.xray$U, dv)
# Plot results
plot(o$overlap, type='h', ylim=c(0,1))
points(o$overlap)
lines(o$overlap.cum, type='b', col='red')
detach(kinesin)
## Calculate overlap from NMA
pdb.a <- read.pdb("1cmk")
pdb.b <- read.pdb("3dnd")
## Fetch CA coordinates
sele.a <- atom.select(pdb.a, "//E/15:350///CA")
sele.b <- atom.select(pdb.b, "//A/1:350///CA")
xyz <- rbind(pdb.a$xyz[sele.a$xyz],
pdb.b$xyz[sele.b$xyz])
## Superimpose
xyz[2,] <- fit.xyz(xyz[1,], xyz[2,], 1:ncol(xyz))
## The difference between the two conformations
dv <- difference.vector( xyz )
## Calculate normal modes
modes <- nma(pdb.a, inds=sele.a)
# Calculate the squared overlap between the normal modes
# and the difference vector
o <- overlap(modes, dv)
Run the code above in your browser using DataLab