From 302f79cac070f15321e5f75258223165b0550890 Mon Sep 17 00:00:00 2001 From: TZVanaalten Date: Sun, 13 Aug 2017 12:00:13 +0100 Subject: [PATCH] JAL-2629 add force alphabet type for HMMER commands --- src/jalview/hmmer/HMMBuildThread.java | 14 ++++++++++++-- src/jalview/hmmer/HMMERCommands.java | 20 +++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/jalview/hmmer/HMMBuildThread.java b/src/jalview/hmmer/HMMBuildThread.java index fb904f9..e9f691b 100644 --- a/src/jalview/hmmer/HMMBuildThread.java +++ b/src/jalview/hmmer/HMMBuildThread.java @@ -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); } diff --git a/src/jalview/hmmer/HMMERCommands.java b/src/jalview/hmmer/HMMERCommands.java index 3b5472a..71a7d10 100644 --- a/src/jalview/hmmer/HMMERCommands.java +++ b/src/jalview/hmmer/HMMERCommands.java @@ -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(); -- 1.7.10.2