From: tva Date: Wed, 10 Jul 2019 14:39:41 +0000 (+0100) Subject: JAL-2629 fix hmsearch and jackhmmer not being able to search alignment X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5b552cc983ae304b23b696498e869dd6724fd1a5;p=jalview.git JAL-2629 fix hmsearch and jackhmmer not being able to search alignment --- diff --git a/src/jalview/hmmer/HMMERParamStore.java b/src/jalview/hmmer/HMMERParamStore.java index 65dd3b8..f7c33b1 100644 --- a/src/jalview/hmmer/HMMERParamStore.java +++ b/src/jalview/hmmer/HMMERParamStore.java @@ -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, diff --git a/src/jalview/hmmer/HMMSearch.java b/src/jalview/hmmer/HMMSearch.java index bf58a27..248af16 100644 --- a/src/jalview/hmmer/HMMSearch.java +++ b/src/jalview/hmmer/HMMSearch.java @@ -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); diff --git a/src/jalview/hmmer/JackHMMER.java b/src/jalview/hmmer/JackHMMER.java index 4435b14..7dbc08b 100644 --- a/src/jalview/hmmer/JackHMMER.java +++ b/src/jalview/hmmer/JackHMMER.java @@ -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); }