PCA for crystal structure and MD simulation

Issue #680 resolved
Aiswarya Pawar created an issue

Hi All,

I’am successfully able to plot PCA for set of crystal structures and the trajectories separately. But i want to plot them together, basically something like projecting one over other. Below i have mentioned individual pca scripts.

for crystal structure-

ids <- c("4LDJ_A","5VQ6_A","5VQ8_A","4L8G","4LPK")
raw.files <-get.pdb(ids)
files <- pdbsplit(raw.files, ids)
pdbs <- pdbaln(files)

pc <- pca(pdbs, rm.gaps=TRUE)
plot(pc,pc.axes=1:2)

for MD trajectory

dcd <- read.dcd('trj.dcd')

pdb <- read.pdb('trj.pdb')

ca.inds <- atom.select(pdb, elety = 'CA')

xyz <- fit.xyz(fixed=pdb$xyz,mobile=dcd, fixed.inds=ca.inds$xyz,mobile.inds=ca.inds$xyz)

pc <- pca.xyz(xyz[, ca.inds$xyz])

plot(pc, col=bwr.colors(nrow(xyz)))

Comments (5)

  1. Xinqiu Yao

    Hi,

    What you need is just the project.pca() function to project crystal structures onto MD PCs or vice versa (see ?project.pca for more detail.

    After the projection, you can add extra data points by e.g. points() or make a new plot with trajectory and crystal structures together.

  2. Log in to comment