Skip to content

Commit

Permalink
Fixed: bug with phyml batch processing
Browse files Browse the repository at this point in the history
  • Loading branch information
diego.darriba committed Sep 1, 2011
1 parent d4e67ff commit 7e3561b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 609 deletions.
20 changes: 16 additions & 4 deletions src/main/java/es/uvigo/darwin/jmodeltest/exe/PhymlSingleModel.java
Expand Up @@ -135,7 +135,7 @@ private void writePhyml3CommandLine(Model currentModel,
if (currentModel.ispF())
commandLine += " -f m"; // changed from -f e DP200509
else
commandLine += " -f 0.25 0.25 0.25 0.25";
commandLine += " -f 0.25,0.25,0.25,0.25";

// optimize pinvar if needed
if (currentModel.ispI())
Expand Down Expand Up @@ -168,6 +168,9 @@ private void writePhyml3CommandLine(Model currentModel,
if (numberOfThreads > 0) {
commandLine += " --num_threads " + numberOfThreads;
}

// avoid memory warning
commandLine += " --no_memory_check";

// do optimize topology?
/*
Expand Down Expand Up @@ -212,9 +215,17 @@ private void executeCommandLine() {
try {
File dir = new File(PHYML_PATH);

// to deal with spaces in path we need to fragment commandline (at
// least it works in MacOS X)
String[] executable = { PHYML_PATH + Utilities.getBinaryVersion() };
String[] executable = new String[1];

File phymlBinary = new File (PHYML_PATH + "phyml");
if (phymlBinary.exists() && phymlBinary.canExecute())
{
executable[0] = phymlBinary.getAbsolutePath();
}
else
{
executable[0] = PHYML_PATH + Utilities.getBinaryVersion();
}
String[] tokenizedCommandLine = commandLine.split(" ");
String[] cmd = Utilities.specialConcatStringArrays(executable,
tokenizedCommandLine);
Expand Down Expand Up @@ -408,6 +419,7 @@ else if (line.length() > 0
} catch (NullPointerException e) {
System.err.println("Error while parsing result data from "
+ currentModel.getName());
e.printStackTrace();
}
phymlStatFile.close();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/es/uvigo/darwin/jmodeltest/exe/RunPhyml.java
Expand Up @@ -31,7 +31,7 @@
* RunPhyml.java
*
* Description: Makes phyml calculate likelihood scores for competing models
* @author Diego Darriba, University of Vigo / University of A Coru–a, Spain
* @author Diego Darriba, University of Vigo / University of A Coruna, Spain
* ddarriba@udc.es
* @author David Posada, University of Vigo, Spain
* dposada@uvigo.es | darwin.uvigo.es
Expand Down
Expand Up @@ -37,7 +37,7 @@
* RunPhymlMPJ.java
*
* Description: Makes phyml calculate likelihood scores for competing models
* @author Diego Darriba, University of Vigo / University of A Coru–a, Spain
* @author Diego Darriba, University of Vigo / University of A Coruna, Spain
* ddarriba@udc.es
* @author David Posada, University of Vigo, Spain
* dposada@uvigo.es | darwin.uvigo.es
Expand Down

0 comments on commit 7e3561b

Please sign in to comment.