Dear Jörg,

I have just tried this and it seems to work for me.

I have created a gist here which shows an example usage on multiple conformations:

https://gist.github.com/ptosco/b9b7341251457fe26441dc17609ae34a

As the notebook contains 3Dmol.js renderings that won't show up in the gist, I have also created an HTML version which may be more convenient for you to browse here:

http://htmlpreview.github.io/?https://gist.githubusercontent.com/ptosco/2bc42766a1672f61135d7d7dcce72223/raw/302e459d98c9f4e2fd0f1f2b23221d54c7bd2d8a/o3a.html

I think the problem in your case might originate from the fact that when you call pyO3A.Align() the transformation is directly applied to the query molecule, and the RMSD is returned.

If you call pyO3A.Trans() after calling pyO3A.Align() the transformation will actually be an identity transformation, as the query has already been aligned when Align() was called, so no further transformation is required. So if you try to apply the transformation to the original coordinates instead, that will result in no change to the coordinates, being an identity.

If you only need the transformation to apply it at a later stage, you should not call Align first.

I hope the above is clear; feel free to contact me if not (also off-list).

Cheers,
Paolo

On 16/06/2019 17:56, Jörg Kurt Wegner wrote:
It seems the shape alignment is in a wrong 3D reference frame - how to fix this? Here a code snippet looping over all conformations, then finding the one with the lowest score. I was under the assumption "query3d" should be at the end in the same reference frame as "references3d", but it is not? Has anyone a working 3D shape alignment, ensuring things are truly aligned in the same reference frame? Thanks /.Joerg

pyO3A=rdMolAlign.GetO3A(query3d_conf, references3d)
rmsd=pyO3A.Align()
score = pyO3A.Score()
rmsd, trans_matrix = pyO3A.Trans()

if highestConfId!=-1:
        rdkit.Chem.AllChem.TransformMol(query3d, trans_matrix, confId=highestConfId, keepConfs=True)

--
LinkedIn <http://linkedin.com/in/joergkurtwegner>, Twitter <http://twitter.com/joergkurtwegner>, FaceBook <http://www.facebook.com/joergkurtwegner>


_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to