JAL-2629 manual curation of HMMs via reference annotation functional
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index a4b494a..9b4e1fe 100644 (file)
@@ -616,6 +616,8 @@ public abstract class AlignmentViewport
 
   protected boolean ignoreBelowBackGroundFrequencyCalculation = false;
 
+  protected boolean infoLetterHeight = false;
+
   protected ResidueShaderI residueShading = new ResidueShader();
 
   @Override
@@ -779,6 +781,10 @@ public abstract class AlignmentViewport
   @Override
   public void setSequenceInformationHash(ProfilesI info, int index)
   {
+    if (hinformation.size() < index + 1)
+    {
+      return;
+    }
     hinformation.set(index, info);
   }
 
@@ -1366,6 +1372,16 @@ public abstract class AlignmentViewport
 
   }
 
+  public void setInfoLetterHeight(boolean b, AlignmentViewPanel ap)
+  {
+    infoLetterHeight = b;
+    if (ap != null)
+    {
+      updateInformation(ap);
+    }
+
+  }
+
   private long sgrouphash = -1, colselhash = -1;
 
   /**
@@ -1426,6 +1442,12 @@ public abstract class AlignmentViewport
     return ignoreBelowBackGroundFrequencyCalculation;
   }
 
+  @Override
+  public boolean isInfoLetterHeight()
+  {
+    return infoLetterHeight;
+  }
+
   // property change stuff
   // JBPNote Prolly only need this in the applet version.
   private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
@@ -1997,6 +2019,7 @@ public abstract class AlignmentViewport
     {
       updateStrucConsensus(ap);
     }
+    initInformation();
     updateInformation(ap);
 
     List<SequenceI> hmmSequences;
@@ -3117,4 +3140,18 @@ public abstract class AlignmentViewport
             + ((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
     return sq;
   }
+
+  public boolean hasReferenceAnnotation()
+  {
+    AlignmentAnnotation[] annots = this.alignment.getAlignmentAnnotation();
+    for (AlignmentAnnotation annot : annots)
+    {
+      if ("RF".equals(annot.label) || annot.label.contains("Reference"))
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
 }