Hi,
I verified the "masses" of my coarse-grained protein system, it seems correct. According to your suggestion, I tried to use MDAnalysis API functions principal_axes and moment_of_inertia to calculate these matrices for a group of selected atoms for my coarse-grained system using the following source code
import MDAnalysis
import numpy as np
u = MDAnalysis.Universe('CG.psf', 'CG.dcd')
CA = u.select_atoms("protein and name CA")
I = CA.moment_of_inertia()
UT = CA.principal_axes()
# transpose the row-vector layout UT = [p1, p2, p3]
U = UT.T
# test that U diagonalizes I
Lambda = U.T.dot(I.dot(U))
print(Lambda)
# check that it is diagonal (to machine precision)
print(np.allclose(Lambda - np.diag(np.diagonal(Lambda)), 0))
My coarse-grained (Martini force field using NAMD) system is an icosahedral capsid protein and it has 181234 atoms. Generally, protein is represented as a bead type according to the Martini force field. Hence, I wrote "protein" in the selection line instead of ("protein and name CA"). Is that correct? Maybe I'm wrong. Then, I got the "FALSE" statement after verifying "print(np.allclose(Lambda - np.diag(np.diagonal(Lambda)), 0))". Could you help me through this problem?
Thanks
With regards
Vinnarasi Saravanan,Postdoctoral fellow,
Chemical Engineering department,
Indian Institute of Technology Bombay,
Mumbai, India.