From eb7824b3ecfdef2aa8c83e4a8520cb866f364d88 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 7 Aug 2006 14:37:33 +0000 Subject: [PATCH] catch out of memory error for consensus when loading groups --- src/jalview/datamodel/SequenceGroup.java | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 161c010..272d81d 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -319,31 +319,37 @@ public class SequenceGroup if(cs == null) return; - cs.setConsensus(AAFrequency.calculate(sequences, 0, getWidth())); - - - if (cs instanceof ClustalxColourScheme) + try { - ((ClustalxColourScheme) cs).resetClustalX(sequences, getWidth()); - } + cs.setConsensus(AAFrequency.calculate(sequences, 0, getWidth())); + if (cs instanceof ClustalxColourScheme) + { + ( (ClustalxColourScheme) cs).resetClustalX(sequences, getWidth()); + } - if (cs.conservationApplied()) - { + if (cs.conservationApplied()) + { Conservation c = new Conservation(groupName, - ResidueProperties.propHash, 3, sequences, 0, getWidth()); + ResidueProperties.propHash, 3, sequences, + 0, getWidth()); c.calculate(); c.verdict(false, 25); - cs.setConservation(c); if (cs instanceof ClustalxColourScheme) { - ((ClustalxColourScheme) cs).resetClustalX(sequences, - getWidth()); + ( (ClustalxColourScheme) cs).resetClustalX(sequences, + getWidth()); } + } } + catch (java.lang.OutOfMemoryError err) + { + System.out.println("Out of memory loading groups: " + err); + } + } /** -- 1.7.10.2