-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getAtomSetWithinSelection and getAtomSetWithinGroup in several files #1023
Comments
That's correct, these methods are attached to a given structure, so it's not currently possible to make selections across different structures/components using these methods. If one structure contains a ligand and another contains a receptor, you can use some code like the following to get the neighbouring atoms. const ligandStructure = ligComponent.structure
const spatialHash = receptorComponent.structure.spatialHash
const pocketAtomSet = receptorComponent.structure.getAtomSet(false) // an empty selection
ligandStructure.eachAtom(
ap => spatialHash.eachWithin(
ap.x, ap.y, ap.z, 4.5,
(pocketAp) => pocketAtomSet.set(pocketAp.index)
)
) |
and then how to display the resulting atoms from pocketAtomSet? |
I think that when you have your AtomSet ready you can give it to a representation (such as stick+ball) by setting the representation selection with your AtomSet. |
The answer was not entirely complete, we also need to add Ultimately, this is the code that works correctly:
|
getAtomSetWithinSelection and getAtomSetWithinGroup doesn't work If we add two structures into one visual scene and label protein atoms from ligand by distance. Both protein and ligand came to scene from different files.
How to display protein atoms around a ligand with a radius if the ligand is loaded as a separate file into the scene?
I used example from Distance-based selection
The text was updated successfully, but these errors were encountered: