attentionbydesign / tymera

Custom Scripts
GNU General Public License v3.0
0 stars 0 forks source link

Chain Selector Ideas #9

Open attentionbydesign opened 3 weeks ago

attentionbydesign commented 3 weeks ago

There is a script somewhere that obtains chain/sequence objects based on the selected atoms.

Things to potentially do with a chain-specific selection:

  1. Toggling display of isolated chain vs. whole molecule; or making other chains transparent

  2. Toggling atomic vs. ribbon view of selected chain

  3. 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

attentionbydesign commented 3 weeks ago

For chain-specific selection:

chimera.selection.currentChains()

returns a chimera.Sequence.StructureSequence object.

Idea to be developed further...

attentionbydesign commented 2 weeks ago

Looks like there already a few standard accelerators under the Molecule Display and Molecule Zones & Selections categories that can help.

Molecule Zones and Selections:

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().

Molecule Display

To do the equivalent of 'show only' for the selected chains, you have to

  1. is Invert selection (selected models)
  2. rh or hr Hide ribbon
  3. ha Hide atoms (which may be displayed by default if there are ligands)

To toggle back to showing everything, you have to

  1. indicate the ribbon style to show the ribbon:
  1. da Display atoms

This is obviously many steps, so perhaps a custom accelerators that works like our current sw, but applied to selected chains.

attentionbydesign commented 2 weeks ago

To close this issue, create functions that can be referenced in custom accelerators that do the following:

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...