Skip to content
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

Question about automatically collapsing filter selection in html #745

Closed
noeliaferruz opened this issue May 11, 2020 · 5 comments
Closed

Comments

@noeliaferruz
Copy link

noeliaferruz commented May 11, 2020

Hi,
I am rendering on a web a protein and a ligand, with the residues around the ligand as well.
This is the code to select the residues around the ligand:

var selection = new NGL.Selection( "not protein and not water");
var radius = 4;
var atomSet = obj[1].structure.getAtomSetWithinSelection( selection, radius );
 // expand selection to complete groups
var atomSet2 = obj[1].structure.getAtomSetWithinGroup( atomSet );
var residues2 = obj[1].addRepresentation("licorice",{
sele: atomSet2.toSeleString(),
})

The selection looks too large in the web though. The users can of course collapse it by hand, but I was wondering if there's a way to automatically collapse it upon loading? Something like, collapse=True (this didn't work)?

Thanks

@fredludlow
Copy link
Collaborator

Do you mean go from a list of atom IDs to something like ":A and 1-4 or 7 or 10". I don't know of a way to do this at the moment but it would certainly be a nice addition. I guess you could fairly easily create a naive implementation (walk through models, chains, residues, atoms and build a big nested and/or statement). For a more thorough job, a quick google suggests the relevant term might be rewriting but it's not an area I have any knowledge of...

@noeliaferruz
Copy link
Author

Hey thank you, eventually found a workaround!

@gph82
Copy link

gph82 commented Jan 7, 2021

a bit late to the party, but, what was the workaround? I have the same question...

@noeliaferruz
Copy link
Author

HI Guillermo!

I actually don't remember. Shortly after I translated the project to mol*.

@gph82
Copy link

gph82 commented Jan 7, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants