package jalview.hmmer;
-import jalview.bin.Cache;
+import jalview.analysis.SeqsetUtils;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
import jalview.gui.JvOptionPane;
-import jalview.gui.Preferences;
import jalview.io.DataSourceType;
import jalview.io.FileParse;
import jalview.io.HMMFile;
import javax.swing.JOptionPane;
-public class HMMBuildThread implements Runnable
+public class HMMBuildThread extends HmmerCommand implements Runnable
{
- HMMERCommands cmds = new HMMERCommands();
-
- AlignFrame af;
-
AlignViewport viewport;
boolean multiJob = false;
af.setProgressBar(MessageManager.getString("status.running_hmmbuild"),
barID);
}
- cmds.HMMERFOLDER = Cache.getProperty(Preferences.HMMER_PATH);
List<SequenceGroup> groups = new ArrayList<>();
if (params != null)
if (af != null)
{
- af.setProgressBar(MessageManager.getString("status.running_hmmbuild"),
- barID);
+ af.setProgressBar("", barID);
}
}
array = alignment.getSequencesArray();
}
- cmds.setHmmSeqs(seqs);
-
if (array.length < 1)
{
if (af != null)
index++;
}
- cmds.uniquifySequences(newArr);
+ uniquifySequences(newArr);
if (forGroup)
{
- cmds.exportData(newArr, stoTemp, null, null, group);
+ exportData(newArr, stoTemp, null, null, group);
}
else
{
- cmds.exportData(newArr, stoTemp, null, null, alignment);
+ exportData(newArr, stoTemp, null, null, alignment);
}
- jalview.analysis.SeqsetUtils.deuniquify(cmds.hash, array);
+ SeqsetUtils.deuniquify(hash, array);
} catch (FileNotFoundException e)
{
*/
private boolean runCommand() throws IOException, InterruptedException
{
- File file = new File(cmds.HMMERFOLDER + "/hmmbuild");
- if (!file.canExecute())
+ String binaryPath = getCommandRoot(HMMBUILD);
+ if (binaryPath == null)
{
- file = new File(cmds.HMMERFOLDER + "/hmmbuild.exe");
- {
- if (!file.canExecute())
- {
- if (af != null)
- {
- JvOptionPane.showInternalMessageDialog(af,
- MessageManager.getString("warn.hmmbuild_failed"));
- }
- return false;
- }
- }
+ return false;
}
- String command = cmds.HMMERFOLDER + cmds.HMMBUILD + cmds.SPACE;
+ String command = binaryPath + SPACE;
String name = null;
if (params != null)
}
- command += "-n " + name.replace(' ', '_') + cmds.SPACE;
+ command += "-n " + name.replace(' ', '_') + SPACE;
if (!alignment.isNucleotide())
{
- command += cmds.FORCEAMINO; // TODO check for rna
+ command += FORCEAMINO; // TODO check for rna
}
else
{
- command += cmds.FORCEDNA;
+ command += FORCEDNA;
}
- command += hmmTemp.getAbsolutePath() + cmds.SPACE
- + stoTemp.getAbsolutePath() + cmds.SPACE;
- return cmds.runCommand(command);
+ command += hmmTemp.getAbsolutePath() + SPACE + stoTemp.getAbsolutePath()
+ + SPACE;
+ return runCommand(command);
}
/**
SequenceI[] seqs = file.getSeqsAsArray();
SequenceI seq = seqs[0];
seq.createDatasetSequence();
- HiddenMarkovModel hmm = file.getHMM();
if (group != null)
{
seq.insertCharAt(0, group.getStartRes(), '-');