-
Hello! R = rms.RMSD(md, # coordinates to align
ref, # reference coordinates
select = '(protein and not name H*) ', #group to superimpose and calculate RMSD
groupselections= ['(resname LIG)']) #groups only for RMSD
R.run(start=0, stop=1000, step=1) My aim is to align the protein first and then calculate the rmsd of the ligand. I was curious if spyrmsd could be added to calculate the rmsd of the ligand. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 16 replies
-
Hello @ldx022, I hope this may help you. |
Beta Was this translation helpful? Give feedback.
-
Hello!
As @davidoskky already pointed out, the adjacency matrix can be constructed from bonding information but the procedure is a bit convoluted because MDAnalysis does not have a function to build the connectivity matrix. I wanted to integrate Relevant code from the MDAKit (please be aware it is still under GPL-v2 but will be re-licensed when MDAnslysis re-licensing will be finished): With # This import will likely change in the future to something simpler...
from spyrmsdkit.analysis.spyrmsd import SPyRMSD
R = SPyRMSD(
u.select_atoms("resname LIG"),
)
R.run() SPyRMSD inherit from As mentioned above, there are test in the MDAKit, but it's not really fully battle-tested (i.e. I haven't used it on a real project yet), so there might be bugs and sharp edges. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your prompt response. I appreciate your suggestions and assistance. As I am new to MDAnalysis, I'm still getting familiar with its code logic. I will take time to thoroughly understand your provided advice when possible. However, I'm currently in a bit of a hurry. I have an existing MDAnalysis conda environment where I've installed spyrmsdkit for testing. Following your advice, I tried the following script module: R = SPyRMSD(md, # coordinates to align
ref, # reference coordinates
select='(protein and not name H*) or (resname XMA)', # group to superimpose and calculate RMSD
groupselections=['(resname LIG)']) # groups only for RMSD
R.run(start=0, stop=1000, step=1) Unfortunately, I encountered this error:
Interestingly, using By the way, for aligning protein residues, I believe whether to use spyrmsd or not doesn't significantly impact the outcome. My main concern is about calculating the RMSD of the ligand in the trajectory against the reference ligand using spyrmsd. Specifically, I've already aligned the trajectory, so how do I directly compute the SPyRMSD for the ligands in this trajectory? Any further advice or suggestions would be greatly appreciated. Thank you once again for your support. |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you for your patient response! Following your suggestions, I implemented the process again and realized that bonding information is needed. Therefore, the topology file must be a .mol2 file. This seems to make direct selection and calculation on proteins difficult, so I had to first align the protein and then extract the ligand's trajectory part: md = mda.Universe("./lig_H.mol2", 'lig.xtc')
ref = mda.Universe("./lig_H.mol2","./LIG.pdb")
LIG = 'resname LIG'
R = SPyRMSD(md.select_atoms('resname LIG and not name H*'),
ref.select_atoms('resname LIG and not name H*'),
)
R.run(start=0, stop=1000, step=1) However, I found that using
Index 28 is precisely the first H atom I excluded. But when I changed it to 'resname LIG', it ran successfully. I suspect this issue is caused by the hydrogen atoms. Should I create a separate .mol2 file for the ligand without H atoms, or is there a more convenient alternative? Thank you for your suggestions! |
Beta Was this translation helpful? Give feedback.
-
@ldx022, thank you very much for testing out I just merged RMeli/spyrmsdkit#1, which should solve the issues you were seeing, and make spyrmsdkit usable to compute small-molecule RMSDs over a (pre-aligned) MDAnalysis trajectory. If you end up using it and encounter other problems, don't hesitate to ask questions, or open an issue in the spyrmsdkit repository. I will try to find some time to add documentation and add it to the MDAKit registry. |
Beta Was this translation helpful? Give feedback.
@ldx022, thank you very much for testing out
spyrmsdkit
and providing feedback!I just merged RMeli/spyrmsdkit#1, which should solve the issues you were seeing, and make spyrmsdkit usable to compute small-molecule RMSDs over a (pre-aligned) MDAnalysis trajectory.
If you end up using it and encounter other problems, don't hesitate to ask questions, or open an issue in the spyrmsdkit repository. I will try to find some time to add documentation and add it to the MDAKit registry.