Viewing AMBER NetCDF .nc output files

Issue #376 resolved
jbabula created an issue

Hello,

I am currently following the vignette titled "Trajectory Analysis with Bio3d" from Grant lab and I am able to perform all calculations as they are presented with no issues, however, I am unable to view the .nc output file from the command write.ncdf(p1, "trj_pc1.nc") on my version of VMD (1.9.2). I am wondering if you were using some type of plugin to view this file or if I need to download a separate program to view it? I was recently able to view the .nc on VMD in only line mode (assuming because only the carbon atoms were present), but it was not color coded to depict low to high atomic displacements and I could not view it in tube or cartoon form. Thank you!

Comments (7)

  1. Xinqiu Yao

    Hi,

    Did you see any error message from VMD when you load the .nc file? If there is no error message but still no molecule shown, it is very likely that you didn't load a topology file before or after the loading of the trajectory. Have a look of the VMD tutorial to learn how to load a topology for a trajectory.

    Also, can you provide the exact commands (along with the version of bio3d and R and your OS type please) you used to generate the "bad" .nc file (If the step mentioned above does not work)?

    The output of write.ncdf() has been tested with my local VMD without any problem. It should work for VMD and many other software supporting the NetCDF format. For helps with VMD visulization, please go to their website for manuals/tutorials (See above link).

  2. jbabula reporter

    I used the same topology file to load the simulation in VMD as was used to generate the mdcrd/dcd files, so that should not be the issue. Also, because I was able to view it in the "line" graphics selection, it appears the topology and nc correspond correctly to each other. I am using R version 3.1.1 and bio3d version 2.2-4 on Red Hat for Linux.

    The commands to generate the .nc file:

    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]) p1 <- mktrj.pca(pc, pc=1, b=pc$au[,1],file="pc1.pdb") write.ncdf(p1, "trj_pc1.nc")

    I will attach the pdb, toplogy, dcd, and nc files.

  3. Xinqiu Yao

    Hi,

    The files you've attached have no problem and I can show them as tube with VMD. To have the color coded with atomic displacements, you need to create a pdb file with the B-factor column filled by e.g. the "atom-wise loading" from the PCA. A command like write.pdb(pdb, b=pc$au[, 1], file='XXX.pdb') could be useful. Then, in VMD, set the Coloring Method as Beta. The commands I used to test are as following:

    pdb <- read.pdb('1433sigma_nowat.pdb')
    trj <- read.ncdf('trj_pc1.nc')
    b <- rmsf(trj) ## Here, I simply calculate RMSF for testing purpose only. You may want to use PC loadings instead (i.e. the pc$au).
    pdb <- trim(pdb, 'calpha')
    write.pdb(pdb, xyz=trj, b=b, file='test.pdb')
    

    View the results with the command VMD test.pdb.

  4. jbabula reporter

    Hi Xin-Qiu,

    Thank you very much for your answer this is exactly the output I am looking for.

  5. Log in to comment