kad-ecoli / TMalign

This repo is outdated. Please use https://github.com/pylelab/USalign instead
https://github.com/pylelab/USalign
11 stars 9 forks source link

asymmetric alignment #5

Closed kad-ecoli closed 5 years ago

kad-ecoli commented 6 years ago

TM-align occasionally generate asymmetric alignment. For example, "TMalign 1x5gA.pdb 2q7nA5.pdb" and "TMalign 2q7nA5.pdb 1x5gA.pdb" does not not generate the same alignment. Similarly, "TMalign 1se9A.pdb 2edpA.pdb" and "TMalign 2edpA.pdb 1se9A.pdb"does not generate the same alignment. I suspect that this is related to the secondary structure intial alignment step. We should check if this is true. If it is, we should generate two pairs of secondary structure alignments (A vs B, and B vs A), and choose the alignment with higher TM-score if these two alignments are not the same.

kad-ecoli commented 5 years ago

For the first asymmetric pair, looks like it is affected by get_initial_fgt.

 ../TMalign 1x5gA.pdb 2q7nA5.pdb
TM get_initial=0.277222
TMiter get_initial=0.607207
TM get_initial_ss=0.155754
TMiter get_initial_ss=0.274813
TM get_initial5=0.555922
TMiter get_initial5=0.594352
TM get_initial_ssplus=0.562675
TMiter get_initial_ssplus=0.607207
TM get_initial_fgt=0.276647
TMiter get_initial_fgt=0.643421
../TMalign 2q7nA5.pdb 1x5gA.pdb
TM get_initial=0.277222
TMiter get_initial=0.607207
TM get_initial_ss=0.155754
TMiter get_initial_ss=0.274813
TM get_initial5=0.555922
TMiter get_initial5=0.594352
TM get_initial_ssplus=0.562675
TMiter get_initial_ssplus=0.607207
TM get_initial_fgt=0.238052

If get_initial_fgt is deleted, both alignments generate the same result. Such asymmetric issue only occurs when Lx==Ly && xlen==ylen

kad-ecoli commented 5 years ago

The second asymetric pair is caused by get_initial_ss (and consequently get_initial_ssplus)

../TMalign 1se9A.pdb 2edpA.pdb
TM get_initial=0.249219
TMiter get_initial=0.393216
TM get_initial_ss=0.1429
TMiter get_initial_ss=0.393216
TM get_initial5=0.324556
TMiter get_initial5=0.351163
TM get_initial_ssplus=0.261395
TMiter get_initial_ssplus=0.370431
TM get_initial_fgt=0.256212
TMiter get_initial_fgt=0.35136
../TMalign 2edpA.pdb 1se9A.pdb
TM get_initial=0.249219
TMiter get_initial=0.393216
TM get_initial_ss=0.141187
TMiter get_initial_ss=0.393484
TM get_initial5=0.324556
TMiter get_initial5=0.351163
TM get_initial_ssplus=0.274308
TMiter get_initial_ssplus=0.361195
TM get_initial_fgt=0.256212
TMiter get_initial_fgt=0.35136

This is caused by asymmetric implement of NWDP_TM. Correctly val[i][0] and val[0][j] initialization apparently fix the issue, even though the asymmetric problem in theory can still occasionally occur.

kad-ecoli commented 5 years ago

Fixed with https://github.com/kad-ecoli/TMalign/commit/5b066877c1bfd87a220ef10ec421f86e139c5660 https://github.com/kad-ecoli/TMalign/commit/57cb9126874b9f4e861cf4ae730fef90a859efe5