Hello,

Is there a way to capture and save the rotation matrix for an alignment in TM-align, in a way that can be applied to the two structures later to replicate the exact superposition (without the need to realign them)? I am referring to the last/best alignment.

## TM-align rotation matrix

**Moderator:** robpearc

### Re: TM-align rotation matrix

Dear user,

You can use -m matrix.txt to output the matrix.

Best

IT Team

You can use -m matrix.txt to output the matrix.

Best

IT Team

### Re: TM-align rotation matrix

Thank you. I have saved the rotation matrix into a separate txt file. My goal is to apply this transformation matrix on the particular structure to recreate the alignment (without having to re-align).

I am using PyMOL which supports transformation of objects but seems to expect a 4x4 matrix whereas the output matrix from TM-align seems to be 3x4.

The example matrix that I have generated is this one:

Would you have any experience or suggestion as to how I could go about applying the TM-align generated matrix to transform a structure in PyMOL?

I am using PyMOL which supports transformation of objects but seems to expect a 4x4 matrix whereas the output matrix from TM-align seems to be 3x4.

The example matrix that I have generated is this one:

Code: Select all

```
-------- Rotation matrix to rotate Chain_1 to Chain_2 ------
m t(m) u(m,1) u(m,2) u(m,3)
1 39.2982021272 0.0880494749 0.0261316153 -0.9957732818
2 21.5621809311 0.9942153416 -0.0640312787 0.0862313737
3 68.0439549421 -0.0615072715 -0.9976057007 -0.0316183733
Code for rotating Chain_1 from (x,y,z) to (X,Y,Z):
do i=1,L
X(i)=t(1)+u(1,1)*x(i)+u(1,2)*y(i)+u(1,3)*z(i)
Y(i)=t(2)+u(2,1)*x(i)+u(2,2)*y(i)+u(2,3)*z(i)
Z(i)=t(3)+u(3,1)*x(i)+u(3,2)*y(i)+u(3,3)*z(i)
enddo
```

### Re: TM-align rotation matrix

Dear user,

If so, you may use the -o option of TM-align/TM-score, then you can get the superposed structures (structure1 aligned to structure2), for example -o sup

Then you will have sup sup_atm etc. files, load the sup_atm (maybe need to re-name it as sup_atm.pdb) by PyMOL, and then you will get the superposed structure in pyMOL. You don't need the matrix.

Best

IT Team

If so, you may use the -o option of TM-align/TM-score, then you can get the superposed structures (structure1 aligned to structure2), for example -o sup

Then you will have sup sup_atm etc. files, load the sup_atm (maybe need to re-name it as sup_atm.pdb) by PyMOL, and then you will get the superposed structure in pyMOL. You don't need the matrix.

Best

IT Team

### Re: TM-align rotation matrix

Thank you, this is what I am currently doing. The reason I want to avoid saving the aligned structures is file size. At scale, this will create plenty of data, whereas the matrix alone is much smaller.

### Re: TM-align rotation matrix

It looks like the 4th (missing) row in the matrix represents "pre-rotation and post-rotation translation vectors respectively". When the matrix is extended by [0,0,0,1], it will be successfully read by PyMOL and the object will be transformed.