consistent percentage gaps filter for conservation calculation.
authorjprocter <Jim Procter>
Thu, 14 Apr 2005 14:43:25 +0000 (14:43 +0000)
committerjprocter <Jim Procter>
Thu, 14 Apr 2005 14:43:25 +0000 (14:43 +0000)
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/TreeCanvas.java

index 3048b2c..c1a7105 100755 (executable)
@@ -783,7 +783,7 @@ public class AlignFrame extends GAlignFrame
                                             sg.sequences, sg.getStartRes(),\r
                                             sg.getEndRes());\r
           c.calculate();\r
-          c.verdict(false, 100);\r
+          c.verdict(false, viewport.ConsPercGaps);\r
           ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs);\r
 \r
           sg.cs = ccs;\r
@@ -827,7 +827,7 @@ if ( viewport.getConservationSelected() )
                                      al.getWidth());\r
 \r
    c.calculate();\r
-   c.verdict(false, 100);\r
+   c.verdict(false, viewport.ConsPercGaps);\r
 \r
    ccs = new ConservationColourScheme(c, cs);\r
 \r
index 5535dbb..89aac5c 100755 (executable)
@@ -79,15 +79,16 @@ public class AlignViewport
   AlignmentAnnotation conservation;\r
   AlignmentAnnotation quality;\r
 \r
+  public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!\r
+\r
   public void updateConservation()\r
   {\r
-    int percGaps = 100; // JBPNote : This should be a scalable property!\r
     Conservation cons = new jalview.analysis.Conservation("All",\r
         jalview.schemes.ResidueProperties.propHash, 1,\r
         alignment.getSequences(), 0,\r
         alignment.getWidth());\r
     cons.calculate();\r
-    cons.verdict(false, percGaps);\r
+    cons.verdict(false, ConsPercGaps);\r
     cons.findQuality();\r
     int alWidth = alignment.getWidth();\r
     Annotation [] annotations = new Annotation[alWidth];\r
@@ -123,14 +124,14 @@ public class AlignViewport
       value = ((Double) cons.quality.get(i)).floatValue();\r
       vprop = value - qmin;\r
       vprop/=qmax;\r
-      qannotations[i] = new Annotation(sequence.charAt(i) + "",\r
-                                      new String().valueOf(value), ' ', value, new Color(minR+maxR*vprop, minG+maxG*vprop, minB+maxB*vprop));\r
+      qannotations[i] = new Annotation(" ",\r
+                                      String.valueOf(value), ' ', value, new Color(minR+maxR*vprop, minG+maxG*vprop, minB+maxB*vprop));\r
     }\r
 \r
     if(conservation==null)\r
     {\r
       conservation = new AlignmentAnnotation("Conservation",\r
-                                             "Conservation of total alignment less than "+percGaps+"% gaps",\r
+                                             "Conservation of total alignment less than "+ConsPercGaps+"% gaps",\r
                                              annotations,\r
                                              0f, // cons.qualityRange[0].floatValue(),\r
                                              11f, // cons.qualityRange[1].floatValue()\r
index e0a1cac..0cbdfbe 100755 (executable)
@@ -248,7 +248,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
                             al.getWidth() );\r
 \r
        c.calculate();\r
-       c.verdict(false, 100);\r
+       c.verdict(false, av.ConsPercGaps);\r
        ConservationColourScheme ccs = new ConservationColourScheme(c, cs);\r
 \r
        av.setGlobalColourScheme( ccs );\r
index 8d747c2..8d505ea 100755 (executable)
@@ -458,7 +458,7 @@ else // remove PIDColouring
                                           ap.av.alignment.getWidth());\r
 \r
         c.calculate();\r
-        c.verdict(false, 100);\r
+        c.verdict(false, ap.av.ConsPercGaps);\r
         ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs);\r
 \r
 \r
index e4d695d..600683f 100755 (executable)
@@ -447,7 +447,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, Print
                                                       sg.getEndRes());\r
 \r
                     c.calculate();\r
-                    c.verdict(false, 100);\r
+                    c.verdict(false, av.ConsPercGaps);\r
                     ccs = new ConservationColourScheme(c, ccs.cs);\r
 \r
                     sg.cs = ccs;\r