Thank you for your continued development of the TMalign tool.
I am interested in using TMalign for a research project where I am comparing the local structural regions of proteins to eachother. For example, I might want to calculate the TM score between the atoms within a 20Å radius of a "centre" residue S100, and another set of atoms surrounding residue S200.
Given that I know that the two serine residues should be "centred" on top of eachother (i.e. their respective atomic coordinates should be (0,0,0)), I would like to evaluate the TM score for the two "spheres" of atoms, but I would like to restrict the TMalign algorithm to only consider finding the optimal rotation during the structural alignment. This is because I want to enforce that the two centre Serine residues are superimposed in the same space and find an optimal pairing of all other atoms around these residues.
I assume something like this is possible given the dynamic programming approach of the algorithm, where combinations of which residues are superimpose to which (in the 2nd structure) are explored.
Thank you in advance.
Restricting TMalign to a given superposition
Moderator: robpearc

 Posts: 74
 Joined: Wed Nov 03, 2021 5:59 pm
Re: Restricting TMalign to a given superposition
I am not exactly sure what you mean. If you want to extract the alignment based on a pair of superimposed structure, you can use the "se" program from https://github.com/pylelab/USalign
Re: Restricting TMalign to a given superposition
Thanks for your reply.
I used the `se` option, but this prevents the alignment from using superposition entirely. What I want to do, is generate an optimal alignment using ROTATION, but WITHOUT TRANSLATION.
For example, aligning two structures with default USalign settings, I get the following rotation matrix:
 The rotation matrix to rotate Structure_1 to Structure_2 
m t[m] u[m][0] u[m][1] u[m][2]
0 1.9397920755 0.4446008751 0.8916147984 0.0857502951
1 18.5252339659 0.3000479175 0.2384483728 0.9236415001
2 11.7807029332 0.8439794483 0.3849226217 0.3735415187
And with `se`, I get:
 The rotation matrix to rotate Structure_1 to Structure_2 
m t[m] u[m][0] u[m][1] u[m][2]
0 0.0000000000 1.0000000000 0.0000000000 0.0000000000
1 0.0000000000 0.0000000000 1.0000000000 0.0000000000
2 0.0000000000 0.0000000000 0.0000000000 1.0000000000
So the output I am trying to get, is the optimal alignment WITH ROTATION from TMalign; but without translating the structures from where they initially are in 3D space. I want the rotation to be around a particular coordinate point (e.g. (0,0,0)).
So for example, the rotation matrix output should contain some real values for u[m][0], u[m][1], u[m][2] ; but should contain all zeroes for t[m] (which is the rotation for the optimal alignment, given that the structure2 is only allowed to ROTATE and not TRANSLATE relative to structure1).
Does that clear up what I am trying to do? Please let me know if I can explain in more detail.
I used the `se` option, but this prevents the alignment from using superposition entirely. What I want to do, is generate an optimal alignment using ROTATION, but WITHOUT TRANSLATION.
For example, aligning two structures with default USalign settings, I get the following rotation matrix:
 The rotation matrix to rotate Structure_1 to Structure_2 
m t[m] u[m][0] u[m][1] u[m][2]
0 1.9397920755 0.4446008751 0.8916147984 0.0857502951
1 18.5252339659 0.3000479175 0.2384483728 0.9236415001
2 11.7807029332 0.8439794483 0.3849226217 0.3735415187
And with `se`, I get:
 The rotation matrix to rotate Structure_1 to Structure_2 
m t[m] u[m][0] u[m][1] u[m][2]
0 0.0000000000 1.0000000000 0.0000000000 0.0000000000
1 0.0000000000 0.0000000000 1.0000000000 0.0000000000
2 0.0000000000 0.0000000000 0.0000000000 1.0000000000
So the output I am trying to get, is the optimal alignment WITH ROTATION from TMalign; but without translating the structures from where they initially are in 3D space. I want the rotation to be around a particular coordinate point (e.g. (0,0,0)).
So for example, the rotation matrix output should contain some real values for u[m][0], u[m][1], u[m][2] ; but should contain all zeroes for t[m] (which is the rotation for the optimal alignment, given that the structure2 is only allowed to ROTATE and not TRANSLATE relative to structure1).
Does that clear up what I am trying to do? Please let me know if I can explain in more detail.

 Posts: 74
 Joined: Wed Nov 03, 2021 5:59 pm
Re: Restricting TMalign to a given superposition
I am afraid what you request is not implementable. It is not possible to implement rotation but no translation.
Re: Restricting TMalign to a given superposition
@zcx Thanks for replying. Can you explain why you think it's not implementable...?
I am happy to look into modifying the underlying source code for TMalign with some tips / pointers. Unless I misunderstand, there must be a way to modify the dynamic programming approach to find the optimal rotation that minimises the TM score (using something like the current algorithm)?
I am happy to look into modifying the underlying source code for TMalign with some tips / pointers. Unless I misunderstand, there must be a way to modify the dynamic programming approach to find the optimal rotation that minimises the TM score (using something like the current algorithm)?