Open tdudgeon opened 9 months ago
Example:
This is with the event map, but the others are similar.
@tdudgeon to check with either @matteoferla or @boriskovar-m2ms if maps can be rendered in NGL at symmetry positions. @ConorFWild if needed, can comment further.
This cannot be achieved in NGL via a parameter. Cf. https://github.com/nglviewer/ngl/blob/d9b2914527f66ff4033778542843c321d8a88264/src/component/component.ts#L265
It would not work I think even if using getSymmetryOperations
and changing a private variable (.matrix
) in the component.
However, can I double check this is indeed a "symmetry positions" problem? The two are not close and it strikes me as an alibi/alias rototranslation difference.
For comparison here is how the equivalent data looks in the old fraglaysis (e.g. using "fragalysis API"). Note that the maps appear in the same region of space, but seem to correspond to a box around the ligand rather than the whole protein.
@boriskovar-m2ms Does any function expose the stage object? I was hoping to inject this snipped to run addAxis(stage)
to whatever page to show the three cartesian axes at the origin.
const addAxis = (stage) => {
let shape = new NGL.Shape("shape", { dashedCylinder: true })
shape.addArrow([ 0, 0, 0 ], [ 10, 0, 0 ], [ 1, 0, 0 ], 1.0);
shape.addText([ 12, 0, 0 ], [ 1, 0, 0 ], 2.5, "x");
shape.addArrow([ 0, 0, 0 ], [ 0, 10, 0 ], [ 0, 1, 0 ], 1.0);
shape.addText([ 0, 12, 0 ], [ 0, 1, 0 ], 2.5, "y");
shape.addArrow([ 0, 0, 0 ], [ 0, 0, 10 ], [ 0, 0, 1 ], 1.0);
shape.addText([ 0, 0, 12 ], [ 0, 0, 1 ], 2.5, "z");
var shapeComp = stage.addComponentFromObject(shape)
shapeComp.addRepresentation("buffer");
shapeComp.autoView()
};
@tdudgeon & @ConorFWild If I open both maps in PyMOL I get the same shift reported in NGL —this is consistent right with you? But when I place a axis caltrop (there here is a snippet) I get:
Alright, so ngl does accept the offset parameter: unfortunatlely (and obviously, really ^^") this alone does not solve the issue of map registration, although it does help.
Steps to solution:
This is likely to be difficult to test, as there are many opportunities for math errors with all the transforms + sym, so eta is not likely to be until the new year @phraenquex
I'll develop against nglview to make sure issues like this don't jump up again
Well, I have a prototype that aligns things correctly for this example:
Now comes the hard part of integrating and testing it ^^"
@phraenquex I revise my update from earlier, if integration is painless it is possible for this to be done tomorrow/before the end of the year.
I'm duly impressed... wow.
Implemented, merged to master and tested on the test dataset:
@tdudgeon Worth checking results from the most recent version (required ligand_neighbourhood_alignment update as well!) look good in Fragalysis and @phraenquex then we can close this?
For reference, the sameish orientation and same contour in coot on the original (pre-aligned!) data: it looks pretty similar ^^
That's wondeful!!
@ConorFWild can you know yet whether this is a completely general fix, or is there a significant risk of corner cases?
@phraenquex Unclear - works for two relatively different systems but we probably won't know until: A. Stuff goes into Fragalysis for real B. We scale up
My feeling is corner cases are only a moderate risk and will be very obvious to users so we are probably good for purple!
I just ran XCA (updated xchem-align and ligand_neighbourhood_alignment repos) and I'm not seeing the maps being aligned when I just open them in NGL.
@ConorFWild Are all changes committed, or is there something different that has to be done to get it to display in NGL?
Any update on this? Do we have a target with maps aligned?
Not yet.
I just ran XCA (updated xchem-align and ligand_neighbourhood_alignment repos) and I'm not seeing the maps being aligned when I just open them in NGL.
@ConorFWild Are all changes committed, or is there something different that has to be done to get it to display in NGL?
Hey Tim, where are the files for this? Would be helpful to be able to look at them so I can see if any offset has been entered into the maps!
If there is an offset, the issue is the method having calculated the wrong one.
If there isn't then you have an install issue.
Just to confirm that this problem seems to be fixed now. Probably best to keep it open until it can be show to be correct in Fragalysis.
Viewing aligned map files in NGL indicates that they are in a different bit of space to the PDB files.