Open JavierSanchez-Utges opened 2 weeks ago
I have noticed that when I pass
{model: 96, resi: 49, chain: 'A', resn: 'LEU'}
directly as the selection, the styles apply only to model 96. However, when I include multiple selections with OR
like so: {or:[{model: 96, resi: 49, chain: 'A', resn: 'LEU'}, {model: 96, resi: 51, chain: 'A', resn: 'THR'}]}
or even just the one using OR
:
{or:[{model: 96, resi: 49, chain: 'A', resn: 'LEU'}]}
the styles apply to my other model too. This made me think that perhaps there is an issue with the way the logic is implemented for the OR
gate.
Help is much appreciated!
I have solved it by specifying again the model directly in the selection:
viewer.addStyle({or:ligandSitesHash[activeModel][ligNam], model: activeModel}, {cartoon:{hidden: false, color: ligColor}, stick: {hidden: false, color: ligColor, radius: stickRadius}});
But I am still confused of why the OR
of different selections, all of the same model, ends up including a different model...
Hi, I am dealing with multiple models and complex selections and I think something is not working as expected, possibly due to the way I build my selections.
First a general question about selections:
I have generated many selections like so, and they all seemed to work so far, selecting the correct residues in the right chains in the specific model.
Now, I am playing with
AND
andOR
gates to do more detailed selections and I just wondered: is this first selection the same as this second one?The issue I have is that when I apply the model to the union of those selections I generated in the loop like so:
The style is also applied to another model, which is unexpected, as in each one of the selections in
ligandSitesHash[activeModel][ligNam]
I specify themodel: activeModel
.This is the array containing the different selections:
and somehow the style is applied to another model (not 96) too.
Thanks a lot!