Icon representing a recipe

Recipe: SelectSegments

created by LociOiling

Profile


Name
SelectSegments
ID
104234
Shared with
Public
Parent
None
Children
None
Created on
December 19, 2020 at 20:49 PM UTC
Updated on
December 19, 2020 at 20:49 PM UTC
Description

Demonstrate dialog.SelectSegments

Best for


Code


segs = dialog.SelectSegments () print ( #segs .. " segments selected" ) seglst = "" for ii = 1, #segs do seglst = seglst .. segs [ ii ] if ii < #segs then seglst = seglst .. "," end end print ( "segments = \"" .. seglst .. "\"" )

Comments


LociOiling Lv 1

This recipe demonstrates dialog.SelectSegments, a new call which replaces the "user pick" option from GUI recipes.

At the moment, there are a few problems with the highlighting when a segment is selected.

The first segment selected is not highlighted.

If the second segment selected comes after the first segment (higher segment number), the first segment selected is highlighted. Clicking the same second segment again clears the highlighting on the first segment.

If the second segment selected comes before the first segment, the second segment is correctly highlighted.

The correct segments are actually selected in each case, it's just that the visuals are confusing.

Another problem is that the selection can be hard to see with certain coloring options. For example, with "rainbow" coloring, a selection in the blue part of the protein is pretty much invisible. Switching to "CPK" or "EnzDes" coloring gets around that issue.