About NMA in Bio3D and Prody

Issue #277 resolved
Xinqiu Yao created an issue

Below are questions I received from a user and my response:


Hi,

I have one more question. Sorry to bother you. I have done pca calculation for the same trajectory ensemble using bio3d and prody. They give the same plots for individual principal components plots. However the values are different. I think prody is doing some type of rescaling. But I dont know what Bio3D does. What are the units and scaling for the principal components?

Thank you so much,

Best,

Tugba


Xin-Qiu Yao wrote 2015-08-14

Hi,

Bio3d does not do any rescaling on PCA results. The unit of each PC is the same as that for 'length'. For example, if the unit for atomic coordinates in your trajectory is angstrom, the unit of PC is angstrom.

The small difference between prody and bio3d you observed might be because of the distinct fitting methods used by the two softwares. Could you let me know a little bit more about the difference? What variables did you compare and how did you calculate the variables with the two softwares?


Tugba N. Ozturk wrote 2015-08-14

In trajectories, units are in angstroms. Therefore, it should be angstroms then. However, in principal component 1 versus 2 plot of mine, pc 1 has the scale from -100 to 150 (the one obtained by Bio3D). Prody gives the same pc on the scale from -3 to 4.

I am performing pca on Md trajectories and in Bio3D, I used

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

line to superpose the frames. I did not align the trajectories in the beginning. Is that correct? In ProDy, it does the alignment.

I calculated pc 1 vs pc 2 plots using the default plotting options in both softwares.

I already copied the script I used in Bio3D. For prody I ran this from the terminal:

prody pca ../../hexamer.dcd --pdb ../../hexamer.pdb --select calpha --all-output --all-figures --projection-figure 1,2

Xin-Qiu Yao wrote 2015-08-14

Hi,

I am not familiar with Prody and so not very sure what caused the difference. It is very likely that Prody does some kind of scaling on the PCs. Could you try a simple scatter plot with x-axis the PC1 from bio3d and the y-axis the PC1 from Prody? If all points follow a straight line it is only the scaling. Otherwise, we may have to dig into more details.

Another thing should be done is to compare the eigenvalues. Are they the same (or very close) between bio3d and prody? Do you have a large eigenvalue associated with PC1 (which usually indicates a very flexible system)?

If you don't mind, I would like to post all our communications here to public place (e.g. under the issue you created for the same question). This would get other developers who may know prody better come in to help.


Tugba N. Ozturk wrote 11 hours ago

Hi

Sorry for the late answer. Eigenvalues calculated by both methods are pretty close, however they are not exactly the same. Prody calculates 449 eigenvalues (first 4 goes like: 6486.39, 4789.92, 4679.64, 3973.51)

and Bio3D calculates like 3852 ( first 4 goes like: 6507.118, 4811.08, 4695.591, 3992.988) I plotted bio3d's first 449 eigenvalues versus prody ones. It looks like a straight line as expected. So I guess it is fine!

I dont know how to add the plot here..

You can surely post everything online.

Best,

Tugba

Comments (2)

  1. Lars Skjærven

    LIne 65 in pca.py says that the super elements of the covariance matrix is divided by the number of coordinate sets (PDB models or structures) in which both of these atoms (i, j) are observed together.

  2. Log in to comment