Closed rtviii closed 3 weeks ago
try with Q.struct.generator.all()
Thanks! What if i have two structures in the tree? Say, 5AFI
and 3J7Z
. How do i go about selecting just the 5AFI
?
Best
Thanks! What if i have two structures in the tree? Say,
5AFI
and3J7Z
. How do i go about selecting just the5AFI
?
One way would be to iterate over ctx.managers.structure.hierarchy.current.structures
, e.g.
for (const s of plugin.managers.structure.hierarchy.current.structures) {
const model = s.model?.cell.obj?.data;
// check model.entry / entryId (it depends how you originally loaded your data)
}
Another ways:
plugin.state.data.selectQ
to select the correct structureGot it. Thanks a lot!
I'm trying to do something really basic: trigger a selection of a whole structure. I can't figure a way to either construct an
MS
query or convert aRef
toLoci
. (I still don't really know how to conceptualize the state tree)Let's say i have a structure,
5AFI
loaded into the viewer. I can select/focus/highlight its individual chains no problem:But what if i wanted to select a whole structure? I'm not:
Structure
by its PDB ID throughQ.struct.generator
(might have just missed something)and neither can i figure out how to feed a
Ref
tomanagers.selection
:I feel like i'm missing something really basic: how ref hashes correspond to state objects and whether Molstar-"internal" things like
Selection
have distinct namespace from the actual atomic structure components inside the state.Anyway, if somebody could toss in a way
[0]
) whole structure viactx.managers.structure.hierarchy.current.structures[0]
, but select any structure by its ID, i feel like something might click for me.Loci
Thanks a ton