JAL-3070 detect presence of existing JABA RNAAliFold client
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index 1a9684f..a9334ff 100644 (file)
@@ -108,33 +108,11 @@ public abstract class AlignmentViewport
    * alignment
    */
 
-  private Map<SequenceI, SequenceCollectionI> hiddenRepSequences;
-
-  protected ColumnSelection colSel = new ColumnSelection();
-
-  public boolean autoCalculateConsensus = true;
-
-  protected boolean autoCalculateStrucConsensus = true;
-
-  protected boolean ignoreGapsInConsensusCalculation = false;
-
   protected boolean ignoreBelowBackGroundFrequencyCalculation = false;
 
   protected boolean infoLetterHeight = false;
 
-  protected ResidueShaderI residueShading = new ResidueShader();
-
-  protected AlignmentAnnotation consensus;
-
-  protected AlignmentAnnotation complementConsensus;
-
   protected AlignmentAnnotation occupancy;
-
-  protected AlignmentAnnotation strucConsensus;
-
-  protected AlignmentAnnotation conservation;
-
-  protected AlignmentAnnotation quality;
   
   /**
    * results of alignment consensus analysis for visible portion of view
@@ -146,19 +124,6 @@ public abstract class AlignmentViewport
    */
   protected ProfilesI hmmProfiles;
 
-  /**
-   * results of cDNA complement consensus visible portion of view
-   */
-  protected Hashtable[] hcomplementConsensus;
-
-  /**
-   * results of secondary structure base pair consensus for visible portion of
-   * view
-   */
-  protected Hashtable[] hStrucConsensus;
-
-  protected Conservation hconservation;
-
   public AlignmentViewport(AlignmentI al)
   {
     setAlignment(al);
@@ -2878,6 +2843,30 @@ public abstract class AlignmentViewport
     viewStyle.setProteinFontAsCdna(b);
   }
 
+  @Override
+  public void setShowComplementFeatures(boolean b)
+  {
+    viewStyle.setShowComplementFeatures(b);
+  }
+
+  @Override
+  public boolean isShowComplementFeatures()
+  {
+    return viewStyle.isShowComplementFeatures();
+  }
+
+  @Override
+  public void setShowComplementFeaturesOnTop(boolean b)
+  {
+    viewStyle.setShowComplementFeaturesOnTop(b);
+  }
+
+  @Override
+  public boolean isShowComplementFeaturesOnTop()
+  {
+    return viewStyle.isShowComplementFeaturesOnTop();
+  }
+
   /**
    * @return true if view should scroll to show the highlighted region of a
    *         sequence
@@ -3217,4 +3206,46 @@ public abstract class AlignmentViewport
       codingComplement.setUpdateStructures(needToUpdateStructureViews);
     }
   }
+
+  /**
+   * Filters out sequences with an eValue higher than the specified value. The
+   * filtered sequences are hidden or deleted. Sequences with no eValues are also
+   * filtered out.
+   * 
+   * @param eValue
+   * @param delete
+   */
+  public void filterByEvalue(double eValue)
+  {
+    for (SequenceI seq : alignment.getSequencesArray())
+    {
+      if ((seq.getAnnotation("Search Scores") == null
+              || seq.getAnnotation("Search Scores")[0].getEValue() > eValue)
+              && seq.getHMM() == null)
+      {
+        hideSequence(new SequenceI[] { seq });
+      }
+    }
+  }
+
+  /**
+   * Filters out sequences with an score lower than the specified value. The
+   * filtered sequences are hidden or deleted.
+   * 
+   * @param score
+   * @param delete
+   */
+  public void filterByScore(double score)
+  {
+    for (SequenceI seq : alignment.getSequencesArray())
+    {
+      if ((seq.getAnnotation("Search Scores") == null
+              || seq.getAnnotation("Search Scores")[0]
+                      .getBitScore() < score)
+              && seq.getHMM() == null)
+      {
+        hideSequence(new SequenceI[] { seq });
+      }
+    }
+  }
 }