jal-2629 fix for hmmbuild failing due to whitespace in the name
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Fri, 25 Aug 2017 13:51:03 +0000 (14:51 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Fri, 25 Aug 2017 16:21:05 +0000 (17:21 +0100)
src/jalview/hmmer/HMMBuildThread.java

index faba183..d5e938a 100644 (file)
@@ -36,6 +36,7 @@ public class HMMBuildThread implements Runnable
   SequenceGroup group;
   List<ArgumentI> params;
 
+  boolean multiJob;
 
   boolean forGroup = false;
 
@@ -95,12 +96,14 @@ public class HMMBuildThread implements Runnable
           {
             alignment = viewport.getAlignment();
             groups.addAll(viewport.getAlignment().getGroups());
+            multiJob = true;
             break;
           }
           else if ("All groups".equals(value))
           {
             alignment = null;
             groups = viewport.getAlignment().getGroups();
+            multiJob = true;
             break;
           }
           else if ("Selected group".equals(value))
@@ -295,7 +298,11 @@ public class HMMBuildThread implements Runnable
         switch (argName)
         {
         case "HMM Name":
-          name = arg.getValue();
+          if (!multiJob)
+          {
+            name = arg.getValue();
+            name = name.trim();
+          }
           break;
         case "Use Reference Annotation":
           command += "--hand ";
@@ -306,8 +313,6 @@ public class HMMBuildThread implements Runnable
       }
     }
 
-    name = name.trim();
-
     if (name == null || "".equals(name))
     {
       if (forGroup)
@@ -327,7 +332,8 @@ public class HMMBuildThread implements Runnable
       }
     }
 
-    command += "-n " + name + cmds.SPACE;
+
+    command += "-n " + name.replace(' ', '_') + cmds.SPACE;
     if (!alignment.isNucleotide())
     {
       command += cmds.FORCEAMINO; // TODO check for rna