JAL-2629 fix hmsearch and jackhmmer not being able to search alignment
[jalview.git] / src / jalview / hmmer / JackHMMER.java
index 4435b14..7dbc08b 100644 (file)
@@ -154,8 +154,6 @@ public class JackHMMER extends HmmerCommand
     args.add("-A");
     args.add(getFilePath(hitsAlignmentFile, true));
 
-    boolean dbFound = false;
-    String dbPath = "";
     File databaseFile = null;
 
     boolean useEvalueCutoff = false;
@@ -204,15 +202,11 @@ public class JackHMMER extends HmmerCommand
         }
         else if (MessageManager.getString(DATABASE_KEY).equals(name))
         {
-          dbFound = true;
-          dbPath = arg.getValue();
-          if (!MessageManager.getString(THIS_ALIGNMENT_KEY).equals(dbPath))
+          databaseFile = new File(arg.getValue());
+          if (!arg.getValue().isEmpty())
           {
-            int pos = dbPath.lastIndexOf(File.separator);
-            databaseName = dbPath.substring(pos + 1);
-            databaseFile = new File(dbPath);
+            searchAlignment = false;
           }
-          searchAlignment = false;
         }
       }
     }
@@ -246,7 +240,10 @@ public class JackHMMER extends HmmerCommand
 
       deleteHmmSequences(copy);
 
-      sequencesHash = stashSequences(copy.getSequencesArray());
+      if (searchAlignment)
+      {
+        sequencesHash = stashSequences(copy.getSequencesArray());
+      }
 
       exportStockholm(copy.getSequencesArray(), databaseFile, null);
     }