I am looking to realign my protein after my simulation before calculating RMSD. From my understanding, I would need a tpr file along with the centered xtc file and may use a python script to carry out structural realignment. Does anyone have a script that can do this in addition to more information on this subject?
Assuming I understood your question: gmx rms command involves two stages: first select a group for least-squares alignment (fitting) to the reference structure, then calculates rmsd.
Thank you. Yes, the selected group is aligned to the reference structure first (tpr), and then rmsd is calculated. My question is more so about a correction to the output xtc file to structurally align it with the reference structure before moving to gmx rms.
In the analysis section of the Lysozyme in water tutorial found here: (http://www.mdtutorials.com/gmx/lysozyme/05_EM.html) we recenter the protein in the output xtc file in the form of a noPBC.xtc file and then we calculate the rmsd in the two steps that you have described.
But based on my current understanding, re-centered and structurally aligned are two different things. As in, if the protein were re-centered then it could still be slightly out of alignment with the reference structure which would therefore influence the rmsd. I am looking to first align the reference structure and the output structure so that they are perfectly superimposed before least-squares fitting and before calculating rmsd.
Any thoughts/advice is greatly appreciated, thank you in advance!
I see, is there a certain selection that I have to make: none, rot+trans, rotxy+transxy, translation, transxy, progressive? Or simply include -fit in the command?
But, this gave the error:
Molecule in topology has atom numbers below and above natoms (8748).
You are probably trying to use a trajectory which does not match the first
8748 atoms of the run input file. How can I use gmx convert-tpr to make an appropriate input tpr file?
The contents of the .tpr have to match the trajectory. So if you only saved a subset of coordinates in the .xtc file, you need to have that same subset in the .tpr file.
I see, thank you. This segment is saved from one part of my simulaiton in md_0_1_align.xtc which came from md_0_1_noPBC.xtc. To do so can I use the command:
gmx convert-tpr -s md_0_1.tpr -f md_0_1_align.xtc -o md_0_1_align.tpr ?
No, because convert-tpr does not take -f or any coordinate/trajectory format. All you need is -s and -o and you can name the output whatever you like (doesn’t have anything to do with the coordinate manipulations in the trajectory, really).
You need to select the group that corresponds to what is in the .xtc file. Your .tpr already has the full system. By selecting “System” again, you are accomplishing nothing.
This is only relevant for mdrun and is not related to your problem.
Okay, I see. Thank you for the correction. So say I am interested in the rmsd of the backbone in this particular case. I carrried out the following steps to write the rmsd.xvg file:
gmx trjconv -s md_0_1.tpr -f md_0_1.xtc -o md_0_1_noPBC.xtc -pbc mol -center (selecting 1 - Protein and 0 - system to re-center)
gmx trjconv -s md_0_1.tpr -f md_0_1_noPBC.xtc -o md_0_1_align.xtc -fit rot+trans (selecting 4 - Backbone for LSQ and 4 - Backbone for output)
There’s nothing “wrong” but I see no reason to only select the backbone for output in your trajectory. If you adopt this convention, you have to go back and run trjconv every time you want to analyze something else about the protein. Stripping water is standard procedure and I recommend just saving the whole protein and fitting to whatever group you like later.