couldn't find the expected colour scale in interpolated structure made by mktrj.pca() funtion
Hi, i tried to make a figure like in the tutorial "Beginning Trajectory Analysis with Bio3d", page.12, figure .7:Vidualization of first princpal component of HIV-! protease. i did everything and got interpolated structure pc1.pdb alng PC1 produced by mktrj.pca() funtion. but when i open this in vmd i dont see any color scale as expected. My script is as follows:
library(bio3d)
library(igraph)
pdb <- read.pdb("nw_nw_GWT_neut_shift.pdb")
dcd <- read.dcd("NW_nw_GWT_stride5.dcd")
inds <- atom.select(pdb, elety = "CA")
trj <- fit.xyz(fixed = pdb$xyz, mobile = dcd, fixed.inds = inds$xyz, mobile.inds = inds$xyz)
pc <- pca.xyz(trj[, inds$xyz])
plot(pc, pc.axes = 1:2, col = bwr.colors(nrow(trj)))
plot(pc, pc.axes = 2:3, col = bwr.colors(nrow(trj)))
write.table(pc$au[,1], file = "contribu_PC1.dat", row.names = FALSE, col.names = FALSE)
write.table(pc$au[,2], file = "contribu_PC2.dat", row.names = FALSE, col.names = FALSE)
write.table(pc$au[,3], file = "contribu_PC3.dat", row.names = FALSE, col.names = FALSE)
print(pc, nmodes = 20)
p1 <- mktrj.pca(pc, pc=1, b=pc$au[,1], file = "pc1.pdb")
p2 <- mktrj.pca(pc, pc=2, b=pc$au[,2], file = "pc2.pdb")
p3 <- mktrj.pca(pc, pc=3, b=pc$au[,3], file = "pc3.pdb")
write.ncdf(p1, "trj_pc1.nc")
write.ncdf(p2, "trj_pc2.nc")
write.ncdf(p3, "trj_pc3.nc")
q()
i am attaching the output files . please have look into these.
2..secondly got error for ploting PC1-PC3 graph plot(pc, pc.axes = 1:3, col = bwr.colors(nrow(trj))). how do i do PC1-PC3 graph separately?
- Now if i want to plot PC1-PC2 graph in some other graphing tool, how can i do that?
regards
Comments (8)
-
-
Hi Kajwal, Remember to color the structure in VMD by b-factor (Beta). Use Trace as drawing method.
What error message did you get for
plot(pc)
? Are you sure you can usepc.axes = 1:3
?All data is in your
pc
object. e.g, access projections in the pc$z attribute. Seehelp(pca.xyz)
for more information. Usewrite.table
to write the PC projections to file, i.e.write.table(pc$z[,1:2], file="proj1-2.dat")
-
not a bug as far as I can see
-
- attached pc1.png
-
Hello sir,
thank you for the response and suggestions. i have managed to create the vmd figure which i have attached above(pc1.png). Now i can say that i am almost there but still missing something to get the desired picture as the tutotial,"Beginning Trajectory Analysis with Bio3d, page.12, figure .7:Visualization of first princpal component of HIV-! protease". specifically i can not see the shift of the structure colored in shaded gray like object. Also i can not see the use of the file trj_pc1.nc in making the vmd figure.
Please spare me and my demands kajwal
-
Your PDB file contains multiple frames. All you need to do is show all (or a subset) of these frames in VMD, and color these as you want. In "Graphical representation" click on "Trajectory" and change "now" to "7:2:24".
-
Hello sir, Good morning from India. just to inform you that i got the desired figure. A heartily thanks for your continuous support.
kajwal
-
- changed status to resolved
- Log in to comment
Hello sir,
Please look into the above query. i am stuck with this and waiting for your comments.
looking forward your response
-kp