catch out of memory error for consensus when loading groups
authoramwaterhouse <Andrew Waterhouse>
Mon, 7 Aug 2006 14:37:33 +0000 (14:37 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 7 Aug 2006 14:37:33 +0000 (14:37 +0000)
src/jalview/datamodel/SequenceGroup.java

index 161c010..272d81d 100755 (executable)
@@ -319,31 +319,37 @@ public class SequenceGroup
         if(cs == null)\r
           return;\r
 \r
-        cs.setConsensus(AAFrequency.calculate(sequences, 0, getWidth()));\r
-\r
-\r
-        if (cs instanceof ClustalxColourScheme)\r
+        try\r
         {\r
-            ((ClustalxColourScheme) cs).resetClustalX(sequences, getWidth());\r
-        }\r
+          cs.setConsensus(AAFrequency.calculate(sequences, 0, getWidth()));\r
 \r
+          if (cs instanceof ClustalxColourScheme)\r
+          {\r
+            ( (ClustalxColourScheme) cs).resetClustalX(sequences, getWidth());\r
+          }\r
 \r
-        if (cs.conservationApplied())\r
-        {\r
+          if (cs.conservationApplied())\r
+          {\r
             Conservation c = new Conservation(groupName,\r
-                    ResidueProperties.propHash, 3, sequences, 0, getWidth());\r
+                                              ResidueProperties.propHash, 3, sequences,\r
+                                              0, getWidth());\r
             c.calculate();\r
             c.verdict(false, 25);\r
 \r
-\r
             cs.setConservation(c);\r
 \r
             if (cs instanceof ClustalxColourScheme)\r
             {\r
-                ((ClustalxColourScheme) cs).resetClustalX(sequences,\r
-                    getWidth());\r
+              ( (ClustalxColourScheme) cs).resetClustalX(sequences,\r
+                                                         getWidth());\r
             }\r
+          }\r
         }\r
+        catch (java.lang.OutOfMemoryError err)\r
+        {\r
+          System.out.println("Out of memory loading groups: " + err);\r
+        }\r
+\r
     }\r
 \r
     /**\r