From: amwaterhouse Date: Fri, 15 Apr 2005 14:58:13 +0000 (+0000) Subject: public vconsensus available for PID and Blosum X-Git-Tag: Release_2_0~413 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bda5c08954f09de8129b4d8498c484d5f3a6b032;p=jalview.git public vconsensus available for PID and Blosum --- diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index b661b87..7fd7461 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -75,6 +75,7 @@ public class AlignViewport showSequenceFeatures = b; } + public Vector vconsensus; AlignmentAnnotation consensus; AlignmentAnnotation conservation; AlignmentAnnotation quality; @@ -157,11 +158,25 @@ public class AlignViewport { Annotation [] annotations = new Annotation[alignment.getWidth()]; - Vector cons = alignment.getAAFrequency(); + // this routine prevents vconsensus becoming a new object each time + // consenus is calculated. Important for speed of Blosum62 + // and PID colouring of alignment + if(vconsensus == null) + vconsensus = alignment.getAAFrequency(); + else + { + Vector temp = alignment.getAAFrequency(); + vconsensus.clear(); + Enumeration e = temp.elements(); + while(e.hasMoreElements()) + { + vconsensus.add(e.nextElement()); + } + } Hashtable hash = null; for (int i = 0; i