JAL-2629 add force alphabet type for HMMER commands
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Sun, 13 Aug 2017 11:00:13 +0000 (12:00 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Sun, 13 Aug 2017 11:00:13 +0000 (12:00 +0100)
src/jalview/hmmer/HMMBuildThread.java
src/jalview/hmmer/HMMERCommands.java

index fb904f9..e9f691b 100644 (file)
@@ -128,8 +128,18 @@ public class HMMBuildThread implements Runnable
   
   private void runCommand() throws IOException, InterruptedException
   {
-    final String command = cmds.HMMERFOLDER + cmds.HMMBUILD + cmds.NAME
-            + af.getName() + cmds.SPACE + hmmTemp.getAbsolutePath()
+    String command = cmds.HMMERFOLDER + cmds.HMMBUILD + cmds.NAME
+            + af.getName() + cmds.SPACE;
+    if (!alignment.isNucleotide())
+    {
+      command += cmds.FORCEAMINO; // TODO check for rna
+    }
+    else
+    {
+      command += cmds.FORCEDNA;
+    }
+
+    command += hmmTemp.getAbsolutePath()
             + cmds.SPACE + stoTemp.getAbsolutePath() + cmds.SPACE;
     cmds.runCommand(command);
   }
index 3b5472a..71a7d10 100644 (file)
@@ -24,11 +24,11 @@ public class HMMERCommands
   public String JALVIEWDIRECTORY = System.getProperty("user.dir")
           + "/";
 
-  public String HMMALIGN = "/hmmalign ";
+  public final String HMMALIGN = "/hmmalign ";
 
-  public String HMMBUILD = "/hmmbuild ";
+  public final String HMMBUILD = "/hmmbuild ";
 
-  public String HMMSEARCH = "/hmmsearch ";
+  public final String HMMSEARCH = "/hmmsearch ";
 
   public String HMMBUFFER;
 
@@ -38,13 +38,19 @@ public class HMMERCommands
 
   public String OUTPUTALIGNMENT;
 
-  public String NAME = "-n ";
+  public final String NAME = "-n ";
 
-  public String SPACE = " ";
+  public final String SPACE = " ";
 
-  public String ALLCOL = "--allcol ";
+  public final String ALLCOL = "--allcol ";
 
-  public String TRIM = "--trim ";
+  public final String TRIM = "--trim ";
+
+  public final String FORCEAMINO = "--amino ";
+
+  public final String FORCEDNA = "--dna ";
+
+  public final String FORCERNA = "--rna ";
 
   Hashtable hash = new Hashtable();