Merge remote-tracking branch 'origin/tasks/JAL-3070_wsinterfaces' into alpha/JAL...
[jalview.git] / src / jalview / util / ProbabilityAnalyserKickstarter.java
index 86d9177..59c0a9f 100644 (file)
@@ -94,7 +94,7 @@ public class ProbabilityAnalyserKickstarter
       // exported and re-read back into the program. This is to ensure that the
       // program can be terminated without losing a large quantity of data. The
       // increment is the number of families read per 'save'.
-      if (command.indexOf("run") > -1)
+      if (command.indexOf("run") > -1 && !(command.indexOf("ToEnd") > -1))
       {
         try
         {
@@ -116,6 +116,25 @@ public class ProbabilityAnalyserKickstarter
         {
           System.out.println("Command failed");
         }
+        continue;
+      }
+      if ((command.indexOf("runToEnd") > -1))
+      {
+        try
+        {
+
+          inputScanner.next();
+          int minCount = inputScanner.nextInt();
+          int maxCount = inputScanner.nextInt();
+          boolean keepRaw = inputScanner.nextBoolean();
+          boolean forClans = inputScanner.nextBoolean();
+          analyser.runToEnd(minCount, maxCount, keepRaw, forClans);
+          System.out.println("Task completed");
+        } catch (Exception e)
+        {
+          System.out.println("Command failed");
+        }
+        continue;
       }
       // terminates program. Syntax is terminate.
       if (command.indexOf("terminate") > -1)
@@ -140,7 +159,9 @@ public class ProbabilityAnalyserKickstarter
         } catch (Exception e)
         {
           System.out.println("Command failed");
+
         }
+        continue;
       }
 
       if (command.indexOf("getFamName") > -1)
@@ -149,12 +170,12 @@ public class ProbabilityAnalyserKickstarter
         {
         inputScanner.next();
         System.out.println(analyser.getFamilyName(inputScanner.nextInt()));
-          inputScanner.close();
-          continue;
+
         } catch (Exception e)
         {
           System.out.println("Command failed");
         }
+        continue;
       }
       if (command.indexOf("sortIntoClans") > -1)
       {
@@ -163,6 +184,33 @@ public class ProbabilityAnalyserKickstarter
           continue;
 
       }
+      if (command.indexOf("setFamilies") > -1)
+      {
+        inputScanner.next();
+        analyser.setFamilies(inputScanner.next());
+        continue;
+
+      }
+
+      if (command.indexOf("setHMMs") > -1)
+      {
+        inputScanner.next();
+        analyser.setHmms(inputScanner.next());
+        continue;
+
+      }
+
+      if (command.indexOf("alignWithinClans") > -1)
+      {
+        inputScanner.next();
+        String export = inputScanner.next();
+        String clans = inputScanner.next();
+        analyser.alignWithinClan(export, clans);
+        continue;
+
+      }
+
+      System.out.println("Unrecognised command");
     }