prody / ProDy

A Python Package for Protein Dynamics Analysis
http://prody.csb.pitt.edu
Other
434 stars 157 forks source link

PCA analysis with magnitudes of motion indicated by arrow length and color #1662

Open kolmorgan opened 1 year ago

kolmorgan commented 1 year ago

I want to perform the PCA analysis and get results with the magnitudes of motion indicated by arrow length and color as quoted, and I saw the "color arrow by mobility issue was closed with #38 before", but I don't know how to do it. Can you tell me how to do it if possible? Thanks. (The quoted figure and its legend were shown below) pca_analysisof_complex_in_paper

"Principal component analysis of both TLR4 chains in the complex when bound to LPA, 33 PA, and 53 PA (the MD-2 chains are omitted for clarity). The dominant, collective mode of motion for each Ca atom is represented by an arrow, with the magnitudes of motion indicated by arrow length and color according to the inset key, in distance units of Ångstroms. The data in (I) were plotted using VMD (visual molecular dynamics) (Humphrey et al., 1996) and represent an interpolation between the two extreme projections around the average TLR4 structure, after projection of the trajectory onto the first eigenvector." #

jamesmkrieger commented 1 year ago

We current don't have an option for that in our plugin, but we'll look into it. Thanks

jamesmkrieger commented 1 year ago

Oh, it says on the closed issue that it doesn't seem possible. I also don't think anyone really has time to figure it out any time soon. I'll keep the issue open, just in case, though.

kolmorgan commented 1 year ago

As I quoted before, the author of the article (Cell Metab. 2018;27(5):1096-1110.e5.) used that and showed the magnitude of motions visually, so I was wondering if you can achieve that in the module. Thanks anyway! I'll ask them how they did it.

jamesmkrieger commented 1 year ago

They used vmd but I don’t think they used nmwiz. Yes, please let us know if you find out what they did.

kolmorgan commented 1 year ago

OK.

kolmorgan commented 1 year ago

Thanks to the authors of the article (Cell Metabolism 2018;27(5),1096-1110.e5), Dr. Graeme Lancaster and Dr. Peter Bond kindly shared the method they used. They use gromacs to generate a simulation, and use gromacs tools to perform PCA and calculate the extreme motions. And then subsequently use VMD to display the results, using this script: https://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/att-15365/PorcupinePlot.tcl

After trying with xxx.dcd file, the similar figure can be obtained after using the prody to generate the motion patterns of the first mode and output the xxx.pdb of the first and the last frame. Subsequently, loading the pdb files into VMD, source the script, and get the desired porcupine plot successfully. It will be more visualized and convenient if that function can be incorporated into prody! Anyway, hope it's helpful.

jamesmkrieger commented 1 year ago

Thanks, that's good to know.

You can use traverseMode to generate ensembles that can be written to pdb or dcd. These should already be able to used with the porcupine plot tcl, I think.

Can you elaborate a bit more what you did and what you think is missing please?

kolmorgan commented 1 year ago

Thanks for the introduction of traverseMode, I'll try to use it.

For my systems, I used NAMD to generate a simulation and loaded it into the prody module in nmwiz of VMD extension. After the PCA analysis, a dcd file of 50 frames was created, the first and last frame of which showed the extent of motion briefly (I think so, if it's not wrong). So I output the first and the last frame to two pdb files and used these two files by sourcing porcupineplot.tcl to generate the figure (as I cited before).

And eventually, I got the plot I wanted. However, I'm not very familiar with tcl script language, so I was modifying it in order to unify the color scale and value for all my different simulation systems. It is pretty convenient indeed. I mean that if this process can be incorporated into the prody module in the normal mode wizard of VMD, that would be very nice. For example, there are no other color and arrow options if I want to draw and color the arrow according to its magnitude of motion, and even to unify the scale for better visualization.

The prody in VMD is already a great module, thanks to your fantastic work. It's just that I think if this function can be incorporated (color the arrow and draw its length according to the magnitudes of motion), it will be icing on the cake.

jamesmkrieger commented 1 year ago

Oh, ok, so this is completely through the normal mode wizard of VMD. Yes, you get 51 frames along each mode and the first and last ones would be the extremes of the motion. The middle one is average structure.

traverseMode is a function in the Python application programming interface of ProDy. You could load your nmd file into there and use it, but I guess it's probably harder than just saving conformations from VMD. I had a brief look at the porcupine tcl script and it looks like it can take a trajectory as well, so maybe you could apply it directly to the 51 frames without saving and loading, but you'd have to actually give it a try and see.

We already have a way of colouring atoms by amount of motion so maybe we could use add an option to the arrow colour dropdown to tell it to match the atom colours helped by what's in the porcupine script.

I'm not sure who will have a chance to actually do this any time soon, but I agree it would be nice feature to have. Thanks!