foldseek
foldseek copied to clipboard
Generate alignments/give rotation&translation matrix
Hi,
It is a very nice software and extremely fast, thank you! One question: would it be possible that the server provides the superimposed structures and/or the translation-rotation matrix for the query vs hits? That would be super useful!
Thank you for your great work!
Thank you! This is quite high on our todo list but it still might need a bit of time to be built.
Hi, are these alignments already available using the command line tool @martin-steinegger , eg to visualise/ superimpose the 3D models of a pair of proteins?
foldseek createdb example/ targetDB
foldseek createdb example/ queryDB
foldseek search queryDB targetDB aln tmpFolder -a
foldseek aln2tmscore queryDB targetDB aln aln_tmscore
foldseek createtsv queryDB targetDB aln_tmscore aln_tmscore.tsv
The aln2tmscore command should contain a rotation computed by TMscore. Be careful this is still not well tested.
@martin-steinegger I get 12 coords in one line; I have not been able to figure out which 3 correspond to translation and which 9 to rotation.
I want to feed this info to rotate the structures "manually" using
https://biopython.org/docs/1.75/api/Bio.PDB.Atom.html#Bio.PDB.Atom.Atom.transform
which takes a 3x3 rotation matrix, however, I am not sure about which value in aln_tmscore.tsv goes where (the array indices).
Thanks for the patient help!
If anyone stumbles upon this: The first 3 entries are translation, the remaining ones rotation, so this
query ref 4.711E-01 59.289 21.504 63.313 -0.707 -0.706 0.041 -0.695 0.704 0.151 -0.135 0.078 -0.988
becomes this:
import numpy as np
rotation = np.array([[-0.707, -0.706, 0.041], [-0.695, 0.704, 0.151], [-0.135, 0.078, -0.988]])
translation = np.array([59.289, 21.504, 63.313])
Is it possible to get these using API?
The json contains tCa for each alignment, list of floats with 3*n_res elements. Plotted a few, turns out they're not the aligned CAs:

We don't compute the rotation matrix server-side in the API. We solved the issue by running TMalign as webassembly on the client.
We will have to discuss if and how we can expose the transformed coordinates in the API. Currently we don't have a solution for that.
I see. Not a big problem, I can download the structures and do it locally. Thanks for the quick reply & awesome work!
@gezmi we added a structural viewer to the foldseek server. You can also get a static HTML using the binary using --format-mode 3
Should the output html from --format-mode 3 include a visualization of the overlaid alignment like the web server does?
It should, does it not work for you? Can you try a different browser?
Thanks for the quick response! It wasn't a browser issue, but your suggestion made me realize it likely due to the way I was serving the html from a webserver; downloading the html and opening it directly worked in all browsers. Awesome software btw! Thanks