ngl
ngl copied to clipboard
Define a volume from residue list, and select all atoms inside volume
Hello everyone. Is there a way to use the NGL selection language to:
- Create a "volume" or a "3d mesh/cube" provided a residue list? (the volume should include all space in between them).
- Return every atom contained in such volume.
The idea is to fill the volume of a protein-protein interface with a different color, and to extract everything contained in such space.
Best Pedro
You can create a StructureView
from a structure and a selection, this has a bounding box (a Box3 instance). Box3 has a contains
method that will test whether a 3D point is within it.
If you don't want an axes-aligned box it's more involved...
The other approach might be to find all atoms in the first protein within some distance of the second protein (and vice-versa). The SpatialHash (structure.spatialHash
) allows you to do this efficiently and build selections for those two sets (which you can then colour differently).
Excellent approach. I'm truly amazed at how powerful the library is. Thank you very much @fredludlow
Can these objects be instantiated from the python nglview API? (not to view them for now ... just to work with the structure/tjframes as a python objects instead of JS)
Best! Pedro
Can these objects be instantiated from the python nglview API?
No I don't think so.