Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git] / src / jalview / ws / jws2 / jabaws2 / RNAalifoldClient.java
index 245c0a0..1b07fe6 100644 (file)
  */
 package jalview.ws.jws2.jabaws2;
 
-import jalview.api.AlignViewportI;
+import jalview.api.FeatureColourI;
 import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
+import jalview.datamodel.features.FeatureMatcherSetI;
 import jalview.util.MessageManager;
-import jalview.ws.gui.AnnotationWsJob;
 import jalview.ws.uimodel.AlignAnalysisUIText;
 
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.TreeSet;
 import java.util.regex.Pattern;
 
@@ -85,9 +87,9 @@ public class RNAalifoldClient extends JabawsAnnotationInstance
   }
 
   @Override
-  List<AlignmentAnnotation> annotationFromScoreManager(
-          AnnotationWsJob running, AlignViewportI alignViewport,
-          boolean[] gapMap)
+  List<AlignmentAnnotation> annotationFromScoreManager(AlignmentI seqs,
+          Map<String, FeatureColourI> featureColours,
+          Map<String, FeatureMatcherSetI> featureFilters)
   {
     List<AlignmentAnnotation> ourAnnot = new ArrayList<>();
 
@@ -103,18 +105,21 @@ public class RNAalifoldClient extends JabawsAnnotationInstance
             .equals(AlifoldResult.contactProbabilities.toString()));
 
     // add annotation for the consensus sequence alignment
-    createAnnotationRowforScoreHolder(alignViewport, gapMap, ourAnnot,
+    createAnnotationRowforScoreHolder(seqs, null,
+            ourAnnot,
             getCalcId(), structs.get(0), null, null);
 
     // Add annotations for the mfe Structure
-    createAnnotationRowforScoreHolder(alignViewport, gapMap, ourAnnot,
+    createAnnotationRowforScoreHolder(seqs, null,
+            ourAnnot,
             getCalcId(), structs.get(1), data.get(1), null);
 
     // decide whether to add base pair contact probability histogram
     int count = 2;
     if (bpScores)
     {
-      createAnnotationRowforScoreHolder(alignViewport, gapMap, ourAnnot,
+      createAnnotationRowforScoreHolder(seqs, null,
+              ourAnnot,
               getCalcId(), structs.get(2), data.get(0), data.get(2));
       count++;
     }
@@ -130,7 +135,7 @@ public class RNAalifoldClient extends JabawsAnnotationInstance
               .equals(AlifoldResult.ensembleValues.toString()))
       {
 
-        createAnnotationRowforScoreHolder(alignViewport, gapMap, ourAnnot,
+        createAnnotationRowforScoreHolder(seqs, null, ourAnnot,
                 getCalcId(), structs.get(i), data.get(i), null);
       }
     }
@@ -138,7 +143,7 @@ public class RNAalifoldClient extends JabawsAnnotationInstance
   }
 
   private static void createAnnotationRowforScoreHolder(
-          AlignViewportI alignViewport, boolean[] gapMap,
+          AlignmentI alignment, boolean[] gapMap,
           List<AlignmentAnnotation> ourAnnot, String calcId, String struct,
           TreeSet<Score> data, TreeSet<Score> descriptionData)
   {
@@ -165,7 +170,7 @@ public class RNAalifoldClient extends JabawsAnnotationInstance
     String typename = typenameAndDescription[0];
     String description = typenameAndDescription[1];
 
-    AlignmentAnnotation annotation = alignViewport.getAlignment()
+    AlignmentAnnotation annotation = alignment
             .findOrCreateAnnotation(typename, calcId, false, null, null);
 
     constructAnnotationFromScoreHolder(gapMap, annotation, struct, data);
@@ -182,7 +187,7 @@ public class RNAalifoldClient extends JabawsAnnotationInstance
 
     annotation.belowAlignment = false;
     // annotation.showAllColLabels = true;
-
+    annotation.validateRangeAndDisplay();
     ourAnnot.add(annotation);
   }