JAL-4095 slightly better threshold setting and todos for improvement
authorJames Procter <j.procter@dundee.ac.uk>
Wed, 22 Feb 2023 12:43:25 +0000 (12:43 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Wed, 22 Feb 2023 12:43:36 +0000 (12:43 +0000)
src/jalview/gui/AnnotationPanel.java

index 82021ac..b68ff01 100755 (executable)
@@ -630,11 +630,15 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
               int c = fr - 1;
               ContactRange cr = forCurrentX.getRangeFor(fr, to);
               double cval;
+              // TODO: could use GraphLine instead of arbitrary picking
+              // TODO: could report mean/median/variance for partitions (contiguous selected vs unselected regions and inter-contig regions)
+              // controls feathering - what other elements in row/column should we select
+              double thresh=cr.getMean()+(cr.getMax()-cr.getMean())*.15;
               while (c > 0)
               {
                 cval = forCurrentX.getContactAt(c);
                 if (// cr.getMin() <= cval &&
-                cval <= cr.getMax())
+                cval <= thresh)
                 {
                   av.getColumnSelection().addElement(c--);
                 }
@@ -648,7 +652,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
               {
                 cval = forCurrentX.getContactAt(c);
                 if (// cr.getMin() <= cval &&
-                cval <= cr.getMax())
+                cval <= thresh)
                 {
                   av.getColumnSelection().addElement(c++);
                 }