ported basic elements of logo and group annotation display, but disabled due to 1...
authorjprocter <Jim Procter>
Fri, 23 Apr 2010 10:55:31 +0000 (10:55 +0000)
committerjprocter <Jim Procter>
Fri, 23 Apr 2010 10:55:31 +0000 (10:55 +0000)
src/jalview/appletgui/AlignViewport.java

index 8b4eb90..684e005 100755 (executable)
@@ -116,6 +116,8 @@ public class AlignViewport
   AlignmentAnnotation conservation;
 
   AlignmentAnnotation quality;
+  AlignmentAnnotation[] groupConsensus;
+  AlignmentAnnotation[] groupConservation;
 
   boolean autocalculateConsensus = true;
 
@@ -505,38 +507,9 @@ public class AlignViewport
 
         hconsensus = new Hashtable[aWidth];
         AAFrequency.calculate(alignment.getSequencesArray(), 0, alignment
-                .getWidth(), hconsensus);
-
-        for (int i = 0; i < aWidth; i++)
-        {
-          float value = 0;
-          if (ignoreGapsInConsensusCalculation)
-          {
-            value = ((Float) hconsensus[i].get(AAFrequency.PID_NOGAPS))
-                    .floatValue();
-          }
-          else
-          {
-            value = ((Float) hconsensus[i].get(AAFrequency.PID_GAPS))
-                    .floatValue();
-          }
-
-          String maxRes = hconsensus[i].get(AAFrequency.MAXRESIDUE)
-                  .toString();
-          String mouseOver = hconsensus[i].get(AAFrequency.MAXRESIDUE)
-                  + " ";
-
-          if (maxRes.length() > 1)
-          {
-            mouseOver = "[" + maxRes + "] ";
-            maxRes = "+";
-          }
-
-          mouseOver += ((int) value + "%");
-          consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ',
-                  value);
-        }
-
+                .getWidth(), hconsensus, includeAllConsensusSymbols);
+        AAFrequency.completeConsensus(consensus,hconsensus,0,aWidth,ignoreGapsInConsensusCalculation, includeAllConsensusSymbols);
+        
         if (globalColourScheme != null)
         {
           globalColourScheme.setConsensus(hconsensus);
@@ -567,12 +540,6 @@ public class AlignViewport
    * 
    * @return consensus sequence as a new sequence object
    */
-  /**
-   * get the consensus sequence as displayed under the PID consensus annotation
-   * row.
-   * 
-   * @return consensus sequence as a new sequence object
-   */
   public SequenceI getConsensusSeq()
   {
     if (consensus == null)
@@ -1538,4 +1505,67 @@ public class AlignViewport
   {
     this.showUnconserved = displayNonconserved;
   }
+
+  /**
+   * consensus annotation includes all percentage for all symbols in column
+   * DISABLED FOR 2.5 RELEASE (bug #60064 logo rendering is not AWT 1.1 compatible)  
+   */
+  private boolean includeAllConsensusSymbols=false;
+  
+  /**
+   * should conservation rows be shown for groups
+   * DISABLED FOR 2.5 RELEASE (bug 62446)
+   */
+  boolean showGroupConservation = false;
+  /**
+   * should consensus rows be shown for groups
+   * DISABLED FOR 2.5 RELEASE (bug 62446)
+   */
+  boolean showGroupConsensus = false;
+  /**
+   * should consensus profile be rendered by default
+   * DISABLED FOR 2.5 RELEASE (bug #60064 logo rendering is not AWT 1.1 compatible)  
+   */
+  public boolean showSequenceLogo = false;
+  /**
+   * should consensus histograms be rendered by default
+   */
+  public boolean showConsensusHistogram = true;
+  /**
+   * @return the showConsensusProfile
+   */
+  public boolean isShowSequenceLogo()
+  {
+    return showSequenceLogo;
+  }
+  /**
+   * @param showSequenceLogo the new value
+  public void setShowSequenceLogo(boolean showSequenceLogo)
+  {
+    this.showSequenceLogo = showSequenceLogo;
+  }
+   */
+  /**
+   * @param showGroupConsensus the showGroupConsensus to set
+   */
+  public void setShowGroupConsensus(boolean showGroupConsensus)
+  {
+    this.showGroupConsensus = showGroupConsensus;
+  }
+  /**
+   * @return the includeAllConsensusSymbols
+   */
+  public boolean isIncludeAllConsensusSymbols()
+  {
+    return false;
+  }
+  
+  /**
+   * 
+   * @return flag to indicate if the consensus histogram should be rendered by default
+   */
+  public boolean isShowConsensusHistogram()
+  {
+    return this.showConsensusHistogram;
+  }
 }