jvkersch / tmtools

Python bindings for the TM-align algorithm and code for protein structure comparison developed by Zhang et al.
GNU General Public License v3.0
26 stars 5 forks source link

How to save aligned structures as .pdb file. #46

Open amani-acog opened 1 month ago

amani-acog commented 1 month ago

Hi, I want to know how to do the following:

  1. I want to save aligned structures as a .pdb file after computing TMScore, is it possible? If so, how to do that?
  2. If I have one of the structure from PBD and one from ColabFold, assuming PDB structure have multiple chains, how can I compute overall TMScore?
jvkersch commented 1 month ago

@amani-acog Have a look at transform_structure in https://github.com/jvkersch/tmtools/blob/main/tmtools/helpers.py#L6. This will allow you to transform the structure, and you can then write it to another PDB file using BioPython.

For the second question, I'm not sure I understand the specifics. Do you align the different chains, and get one TM score per chain? How do you define the overall TMScore?

amani-acog commented 1 month ago

Hi, thank you for your response. I am not a domain expert. So I have some doubts that I need to get clarified.

  1. Regarding the second question: If I have one of the structure from PBD and one from ColabFold, assuming PDB structure have multiple chains, how can I compute overall TMScore?

    I have explored tmtools from OpenStructures as well, they are providing only one TMScore which is matching with one of your TMScore. I assumed TMScore from openstructures is overall tmscore.

  2. You are providing 2 TMScores, what are they? are they tmscore of each chain?
  3. You are providing RMSD score as well. How you are calculating that. When I align 2 structures from PyMol I am getting values(RMSD: 72) which is very different from your library(RMSD: 5). Is RMSD is calculated only on the aligned sequence, rather than considering entire sequence?
jvkersch commented 1 month ago

@amani-acog Keep in mind that this library is just a thin wrapper around the original TMalign code, which is not mine. So if you have structural questions about how the library works, it may be better to consult the original code and documentation: https://zhanggroup.org/TM-align/.

  1. I still don't understand what the overall TMscore is. You'll get one TMscore for each pair of aligned chains, but I don't know how to combine those into an overall TMscore.
  2. The two TMscores are just normalized differently: TM1 is normalized by the length of the second protein, and similar for `TM2.
  3. Yes, I suspect that that is the difference (RMSD being computed only on the aligned sequence, not on the full sequence).