JAL-2629 for multi-job hmmbuilds, group names are now the HMM names
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Wed, 30 Aug 2017 14:17:27 +0000 (15:17 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Wed, 30 Aug 2017 14:17:27 +0000 (15:17 +0100)
src/jalview/hmmer/HMMBuildThread.java

index 4e0fd08..2ff89c1 100644 (file)
@@ -32,6 +32,7 @@ public class HMMBuildThread implements Runnable
 
   AlignViewport viewport;
 
+  boolean multiJob = false;
   AlignmentI alignment;
   SequenceGroup group;
   List<ArgumentI> params;
@@ -95,12 +96,20 @@ public class HMMBuildThread implements Runnable
           {
             alignment = viewport.getAlignment();
             groups.addAll(viewport.getAlignment().getGroups());
+            if (groups.size() > 0)
+            {
+              multiJob = true;
+            }
             break;
           }
           else if ("All groups".equals(value))
           {
             alignment = null;
             groups = viewport.getAlignment().getGroups();
+            if (groups.size() > 0)
+            {
+              multiJob = true;
+            }
             break;
           }
           else if ("Selected group".equals(value))
@@ -128,12 +137,9 @@ public class HMMBuildThread implements Runnable
         }
       }
     }
-    else
+    else if (viewport != null)
     {
-      if (viewport != null && alignment == null)
-      {
-        alignment = viewport.getAlignment();
-      }
+      alignment = viewport.getAlignment();
     }
 
     if (alignment != null)
@@ -314,16 +320,14 @@ public class HMMBuildThread implements Runnable
       }
     }
 
+    if (forGroup && multiJob)
+    {
+      name = group.getName() + "_HMM";
+    }
 
 
     if (name == null || "".equals(name))
     {
-      if (forGroup)
-      {
-        name = group.getName();
-      }
-      else
-      {
         if (af != null)
         {
           name = af.getTitle();
@@ -332,7 +336,7 @@ public class HMMBuildThread implements Runnable
         {
           name = "Alignment";
         }
-      }
+
     }
 
     command += "-n " + name.replace(' ', '_') + cmds.SPACE;