JAL-975 - ensure we only submit ungapped, padded alignment data to AACon - otherwise...
[jalview.git] / src / jalview / ws / jws2 / AAConsClient.java
index 7aaac5b..c76ea1c 100644 (file)
@@ -23,10 +23,11 @@ public class AAConsClient extends JabawsAlignCalcWorker
           WsParamSetI preset, List<Argument> paramset)
   {
     super(service, alignFrame, preset, paramset);
-    submitGaps=true;
-    alignedSeqs=true;
-    nucleotidesAllowed=false;
-    proteinAllowed=true;
+    submitGaps = true;
+    alignedSeqs = true;
+    nucleotidesAllowed = false;
+    proteinAllowed = true;
+    gapMap=new boolean[0];
   }
 
   public String getServiceActionText()
@@ -98,6 +99,14 @@ public class AAConsClient extends JabawsAlignCalcWorker
                     x = val;
                   }
                 }
+                // if we're at a gapped column then skip to next ungapped position
+                if (gapMap != null && gapMap.length > 0)
+                {
+                  while (!gapMap[i])
+                  {
+                    elm[i++]=new Annotation("", "" , ' ', Float.NaN);
+                  }
+                }
                 elm[i] = new Annotation("", "" + val, ' ', val);
               }