Open attentionbydesign opened 3 weeks ago
For chain-specific selection:
chimera.selection.currentChains()
returns a chimera.Sequence.StructureSequence
object.
Idea to be developed further...
Looks like there already a few standard accelerators under the Molecule Display and Molecule Zones & Selections categories that can help.
sc Select connected atoms/bonds
This is basically your chain selector; you select any region, and it will expand the selection to all atoms/bonds connected to said selection. Because this only selects connected items, it will exclude ligands and potentially non-contiguous chains (e.g., TnT-core to TnT1 if there is no dotted line; note that the dotted line does imply a connection so everything should actually work in this case). However, in order to truly select the whole chain, see the new function in commonfunctions.py called select_chains().
To do the equivalent of 'show only' for the selected chains, you have to
is
Invert selection (selected models)rh
or hr
Hide ribbonha
Hide atoms (which may be displayed by default if there are ligands)To toggle back to showing everything, you have to
rr
Round ribbon (can make this the default?)re
Edged ribbonrf
Flat ribbonda
Display atomsThis is obviously many steps, so perhaps a custom accelerators that works like our current sw
, but applied to selected chains.
To close this issue, create functions that can be referenced in custom accelerators that do the following:
select_chain()
vs. the standard select_connected()
aka the sc
accelerator)The "grouped chain selections" mentioned earlier are already somewhat built-in to how both sc
and select_chains()
work; you can click regions from multiple chains and the function ultimately selects the combination of all connected or all chains, respectively. However, it would be more satisfying if the selection iteratively appeared as you clicked on a given chain - perhaps even more so if you could turn on a selection mode where merely hovering over the chain will highlight it for potential inclusion in a cumulative selection...
There is a script somewhere that obtains chain/sequence objects based on the selected atoms.
Things to potentially do with a chain-specific selection:
Toggling display of isolated chain vs. whole molecule; or making other chains transparent
Toggling atomic vs. ribbon view of selected chain
Grouped chain selections; clicking on individual chains and adding them to the whole selection (doesn't quite work with dragging the box, because might overlap with unwanted chains); would make selecting subregions of a model more intuitive