+ return true;
+ }
+
+ /**
+ * Checks if a file can be executed
+ *
+ * @param path
+ * the path to the file
+ * @return
+ */
+ public boolean canExecute(String path)
+ {
+ File file = new File(path);
+ if (!file.canExecute())
+ {
+ file = new File(path + ".exe");
+ {
+ if (!file.canExecute())
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Runs hmmbuild to check if it is working. While doing this it parses the
+ * version of HMMER.
+ *
+ * @param frame
+ * @return
+ */
+ public boolean validateHMMBuild(AlignmentI alignment)
+ {
+ HMMBuildThread hmmbuild = new HMMBuildThread(alignment);
+ hmmbuild.hmmbuildWaitTillComplete();
+ SequenceI hmmSeq = alignment.getSequenceAt(1);
+ HiddenMarkovModel hmm;
+ if (hmmSeq.isHMMConsensusSequence() && hmmSeq.getHMM() != null)
+ {
+ hmm = hmmSeq.getHMM();
+
+ if (hmm.getNumberOfSymbols() < 1)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ String header = hmm.getFileHeader();
+ if (header == null)
+ {
+ return false;
+ }
+ else
+ {
+ Scanner scanner = new Scanner(header);
+ scanner.next();
+ String string = scanner.next();
+ String version = string.substring(1);
+ Cache.setProperty("HMMER_VERSION", version);
+ scanner.close();
+