JAL-2629 fix hmsearch and jackhmmer not being able to search alignment
authortva <tva@10.205.251.175>
Wed, 10 Jul 2019 14:39:41 +0000 (15:39 +0100)
committertva <tva@10.205.251.175>
Wed, 10 Jul 2019 14:39:41 +0000 (15:39 +0100)
src/jalview/hmmer/HMMERParamStore.java
src/jalview/hmmer/HMMSearch.java
src/jalview/hmmer/JackHMMER.java

index 65dd3b8..f7c33b1 100644 (file)
@@ -146,9 +146,10 @@ public final class HMMERParamStore implements ParamDatastoreI
             100, 0, 100000));
     args.add(new RadioChoiceParameter(
             MessageManager.getString(HMMSearch.REPORTING_CUTOFF_KEY), null,
-            Arrays.asList(HMMSearch.CUTOFF_NONE, HMMSearch.CUTOFF_EVALUE,
-                    HMMSearch.CUTOFF_SCORE),
-            HMMSearch.CUTOFF_EVALUE));
+            Arrays.asList(MessageManager.getString(HMMSearch.CUTOFF_NONE),
+                    MessageManager.getString(HMMSearch.CUTOFF_EVALUE),
+                    MessageManager.getString(HMMSearch.CUTOFF_SCORE)),
+            MessageManager.getString(HMMSearch.CUTOFF_EVALUE)));
     args.add(new LogarithmicParameter(
             MessageManager.getString(HMMSearch.SEQ_EVALUE_KEY),
             MessageManager.getString("label.seq_e_value_desc"), false, 1D,
index bf58a27..248af16 100644 (file)
@@ -196,11 +196,13 @@ public class HMMSearch extends HmmerCommand
         else if (MessageManager.getString(REPORTING_CUTOFF_KEY)
                 .equals(name))
         {
-          if (CUTOFF_EVALUE.equals(arg.getValue()))
+          if (MessageManager.getString(CUTOFF_EVALUE)
+                  .equals(arg.getValue()))
           {
             useEvalueCutoff = true;
           }
-          else if (CUTOFF_SCORE.equals(arg.getValue()))
+          else if (MessageManager.getString(CUTOFF_SCORE)
+                  .equals(arg.getValue()))
           {
             useScoreCutoff = true;
           }
@@ -229,16 +231,11 @@ public class HMMSearch 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;
         }
         else if (MessageManager.getString(RETURN_N_NEW_SEQ).equals(name))
         {
@@ -276,7 +273,10 @@ public class HMMSearch extends HmmerCommand
       AlignmentI copy = new Alignment(al);
       deleteHmmSequences(copy);
 
-      sequencesHash = stashSequences(copy.getSequencesArray());
+      if (searchAlignment)
+      {
+        sequencesHash = stashSequences(copy.getSequencesArray());
+      }
 
       exportStockholm(copy.getSequencesArray(), databaseFile, null);
 
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);
     }