more clustalx bugs fixed
authoramwaterhouse <Andrew Waterhouse>
Wed, 25 May 2005 17:45:55 +0000 (17:45 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 25 May 2005 17:45:55 +0000 (17:45 +0000)
src/jalview/appletgui/SeqPanel.java
src/jalview/gui/SeqPanel.java

index 1a6853b..3a707de 100755 (executable)
@@ -370,14 +370,35 @@ public class SeqPanel extends Panel
     av.updateConservation();\r
     av.updateConsensus();\r
 \r
+    // Y O Y CLUSTALX\r
     ColourSchemeI cs = av.getGlobalColourScheme();\r
     if(cs instanceof ConservationColourScheme)\r
-      cs = ( (ConservationColourScheme) cs).cs;\r
+    {\r
+      ConservationColourScheme ccs =  (ConservationColourScheme) cs;\r
+      if(ccs.cs instanceof ClustalxColourScheme)\r
+     {\r
+        jalview.analysis.Conservation c = new jalview.analysis.Conservation\r
+            ("All",\r
+            ResidueProperties.propHash, 3,\r
+            av.alignment.getSequences(), 0,\r
+            av.alignment.getWidth() - 1);\r
+        c.calculate();\r
+        c.verdict(false, av.ConsPercGaps);\r
+\r
+        ClustalxColourScheme cxs = (ClustalxColourScheme)ccs.cs;\r
+        cxs.resetClustalX(av.alignment.getSequences(),  av.alignment.getWidth());\r
+        ccs = new ConservationColourScheme(c, cxs);\r
+        av.setGlobalColourScheme(ccs);\r
+     }\r
+    }\r
 \r
     if(cs instanceof ClustalxColourScheme)\r
-      cs = new ClustalxColourScheme(av.alignment.getSequences(), av.alignment.getWidth());\r
+    {\r
+      ((ClustalxColourScheme)cs).resetClustalX(av.alignment.getSequences(),\r
+                                    av.alignment.getWidth());\r
+      av.setGlobalColourScheme(cs);\r
+    }\r
 \r
-    ap.alignFrame.changeColour(cs);\r
 \r
   }\r
 \r
index ca09c97..b48861a 100755 (executable)
@@ -6,6 +6,7 @@ import jalview.datamodel.*;
 import javax.swing.*;\r
 import java.util.*;\r
 import jalview.schemes.*;\r
+import jalview.analysis.Conservation;\r
 \r
 public class SeqPanel extends JPanel\r
 {\r
@@ -374,14 +375,33 @@ public class SeqPanel extends JPanel
     av.updateConservation();\r
     av.updateConsensus();\r
 \r
+    // Y O Y CLUSTALX\r
     ColourSchemeI cs = av.getGlobalColourScheme();\r
     if(cs instanceof ConservationColourScheme)\r
-      cs = ( (ConservationColourScheme) cs).cs;\r
+    {\r
+      ConservationColourScheme ccs =  (ConservationColourScheme) cs;\r
+      if(ccs.cs instanceof ClustalxColourScheme)\r
+     {\r
+        Conservation c = new Conservation("All",\r
+                                          ResidueProperties.propHash, 3,\r
+                                          av.alignment.getSequences(), 0,\r
+                                          av.alignment.getWidth() - 1);\r
+        c.calculate();\r
+        c.verdict(false, av.ConsPercGaps);\r
+\r
+        ClustalxColourScheme cxs = (ClustalxColourScheme)ccs.cs;\r
+        cxs.resetClustalX(av.alignment.getSequences(),  av.alignment.getWidth());\r
+        ccs = new ConservationColourScheme(c, cxs);\r
+        av.setGlobalColourScheme(ccs);\r
+     }\r
+    }\r
 \r
     if(cs instanceof ClustalxColourScheme)\r
-      cs = new ClustalxColourScheme(av.alignment.getSequences(), av.alignment.getWidth());\r
-\r
-    ap.alignFrame.changeColour(cs);\r
+    {\r
+      ((ClustalxColourScheme)cs).resetClustalX(av.alignment.getSequences(),\r
+                                    av.alignment.getWidth());\r
+      av.setGlobalColourScheme(cs);\r
+    }\r
 \r
   }\r
 \r
@@ -496,14 +516,7 @@ public class SeqPanel extends JPanel
        repaint();\r
     }\r
     else\r
-    {\r
-      if(stretchGroup.cs !=null && stretchGroup.cs.canThreshold())\r
-      {\r
-        ResidueColourScheme rcs =  (ResidueColourScheme) stretchGroup.cs;\r
         SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup.getName());\r
-      }\r
-\r
-    }\r
 \r
 \r
     changeEndRes = false;\r