Skip to content

Commit

Permalink
Merge pull request #86 from MesquiteProject/development
Browse files Browse the repository at this point in the history
Mesquite 3.6
  • Loading branch information
DMaddison authored Dec 28, 2018
2 parents 15c4f35 + cb82fce commit 36c9efa
Show file tree
Hide file tree
Showing 152 changed files with 2,535 additions and 1,091 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
<classpathentry exported="true" kind="lib" path="jars/commons-math3-3.6.1.jar"/>
<classpathentry kind="lib" path="jars/byte-buddy-agent-1.7.8.jar"/>
<classpathentry exported="true" kind="lib" path="jars/dom4j-2.0.2.jar"/>
<classpathentry exported="true" kind="lib" path="jars/jsch-0.1.54.jar"/>
<classpathentry kind="output" path="Mesquite_Folder"/>
</classpath>
1 change: 1 addition & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.6
Binary file not shown.
Binary file modified Additional Files/jars.zip
Binary file not shown.
Binary file removed Mesquite_Folder.zip
Binary file not shown.
37 changes: 20 additions & 17 deletions Source/mesquite/Mesquite.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,28 @@ public class Mesquite extends MesquiteTrunk
{
/*.................................................................................................................*/
public String getCitation() {
return "Maddison, W.P. & D.R. Maddison. 2018. Mesquite: A modular system for evolutionary analysis. Version 3.51. http://www.mesquiteproject.org";
return "Maddison, W.P. & D.R. Maddison. 2018. Mesquite: A modular system for evolutionary analysis. Version 3.6. http://www.mesquiteproject.org";
}
/*.................................................................................................................*/
public String getVersion() {
return "3.51";
return "3.6";
}

/*.................................................................................................................*/
public int getVersionInt() {
return 351;
return 360;
}
/*.................................................................................................................*/
public double getMesquiteVersionNumber(){
return 3.51;
return 3.6;
}
/*.................................................................................................................*/
public String getDateReleased() {
return "June 2018"; //"April 2007";
return "December 2018"; //"April 2007";
}
/*.................................................................................................................*/
public boolean isPrerelease(){
return false;
}

/*.................................................................................................................*/
Expand All @@ -69,24 +73,20 @@ public String getHomePhoneNumber(){
return "https://raw.githubusercontent.com/MesquiteProject/MesquiteCore/development/noticesAndUpdates/noticesPrerelease.xml";


/* Version 3.2 through 3.4
/* Version 3.2 through 3.4
if (!isPrerelease() && !debugMode)
return "https://raw.githubusercontent.com/MesquiteProject/MesquiteCore/master/noticesAndUpdates/notices.xml";
else
return "https://raw.githubusercontent.com/MesquiteProject/MesquiteCore/development/noticesAndUpdates/noticesPrerelease.xml";
*/
/* Version 2.75 through 3.11
*/

/* Version 2.75 through 3.11
if (!isPrerelease() && !debugMode)
return "http://mesquiteproject.org/mesquite/notice/notices.xml";
else
return "http://mesquiteproject.org/mesquite/prereleasenotices/notices.xml";
*/
}
/*.................................................................................................................*/
public boolean isPrerelease(){
return false;
*/
}
/*.................................................................................................................*/
public void getEmployeeNeeds(){ //This gets called on startup to harvest information; override this and inside, call registerEmployeeNeed
Expand Down Expand Up @@ -1273,7 +1273,8 @@ private void openMesquiteFAQ(){
/*End new code added April.02.07 oliver*/

public void employeeQuit(MesquiteModule mb){
helpSearchManager.employeeQuit(mb);
if (helpSearchManager!=null)
helpSearchManager.employeeQuit(mb);
super.employeeQuit(mb);
}
/*.................................................................................................................*/
Expand Down Expand Up @@ -2462,6 +2463,8 @@ else if (MesquiteTrunk.isMacOSX()) {

} catch (NoSuchMethodError e) {
}
catch (NoClassDefFoundError e) { //WAYNECHECK: DAVIDCHECK: need to add alternative macos application event handling methods for post-1.8 Java
}
}
}

Expand Down Expand Up @@ -2667,7 +2670,7 @@ static void addToStartupNotices(String s){
Method gsn = starter.getClass().getDeclaredMethod("getStartupNotices", null);
startupNotices = (Vector)gsn.invoke(starter, null);
} catch (Exception e) {
System.out.println("Failed to get startup notices vector");
System.out.println("Failed to get startup notices vector");
}
}
if (startupNotices != null)
Expand Down Expand Up @@ -2719,7 +2722,7 @@ public static URLClassLoader makeModuleClassLoader(String mesquiteDirectoryPath,
//Go through each package listed in classpaths.txt
for (int i = 0; i<paths.length; i++){
if (!paths[i].startsWith("#")) { //paths can be commented out with leading #

addClasspathsHere(urls, jars, MesquiteFile.composePath(mesquiteDirectoryPath, correctClassPath(paths[i])));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public boolean forceAlignment(DNAData dnaData, ProteinData proteinData, int it)
int numBases = dnaData.getNumberApplicableInTaxon(it, true);
int numAAs = proteinData.getNumberApplicableInTaxon(it, true);
if (numAAs*3!= numBases) {
logln("Number of nucleotides in sequence does not correspond to number of amino acids in protein sequence (taxon " + it + ")");
logln("Number of nucleotides in sequence does not correspond to number of amino acids in protein sequence (taxon " + it+1 + ")");
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/mesquite/align/lib/ExternalSequenceAligner.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ else if (!(firstTaxon==0 && lastTaxon==matrix.getNumTaxa())) { // we are doing
// MesquiteFile.putFileContents(filePath, fileBuffer.toString(), true);

StringBuffer shellScript = new StringBuffer(1000);
shellScript.append(ShellScriptUtil.getChangeDirectoryCommand(rootDir));
shellScript.append(ShellScriptUtil.getChangeDirectoryCommand(MesquiteTrunk.isWindows(), rootDir));
shellScript.append(getProgramCommand());
StringBuffer argumentsForLogging = new StringBuffer();
logln("Options: " + programOptions + " " + getQueryProgramOptions());
Expand All @@ -362,7 +362,7 @@ else if (!(firstTaxon==0 && lastTaxon==matrix.getNumTaxa())) { // we are doing
argumentsForLogging.append(" " + programOptions + " "+ getQueryProgramOptions());
}
shellScript.append(StringUtil.lineEnding());
shellScript.append(ShellScriptUtil.getRemoveCommand(runningFilePath));
shellScript.append(ShellScriptUtil.getRemoveCommand(MesquiteTrunk.isWindows(), runningFilePath));

String scriptPath = rootDir + "alignerScript" + MesquiteFile.massageStringToFilePathSafe(unique) + ".bat";
if (scriptBased)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* Mesquite source code. Copyright 2005 and onward, David Maddison and Wayne Maddison.Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out.Perhaps with your help we can be more than a few, and make Mesquite better.Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.Mesquite's web site is http://mesquiteproject.orgThis source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) */package mesquite.basic.VoucherInfoFromFlexTable; import mesquite.lib.*;import java.util.Vector;/* ======================================================================== */public class VoucherInfoFromFlexTable extends OTUIDCodeInfoSource { Vector tables, paths; boolean warned = false; /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { paths = new Vector(); tables = new Vector(); return true; } /*.................................................................................................................*/ private String getPath(String databaseID){ String where = null; if (databaseID.indexOf(":")<0) where = databaseID; else where = databaseID.substring(databaseID.indexOf(":")+1, databaseID.length()); if (!warned && StringUtil.blank(where)) { MesquiteMessage.warnProgrammer("Path of voucher info file is empty; databaseID = " + databaseID); warned = true; } return where; } /*.................................................................................................................*/ private String getDBID(String databaseID){ String which = null; if (databaseID.indexOf(":")<0) which = databaseID; else which = databaseID.substring(0, databaseID.indexOf(":")); if (!warned && StringUtil.blank(which)) { MesquiteMessage.warnProgrammer("DBID of voucher info file is empty; databaseID = " + databaseID); warned = true; } return which; } private int findPath(String path){ if (path == null) return -1; for (int i=0; i<paths.size(); i++) if (path.equals(paths.elementAt(i))) return i; return -1; } private int findRow(String[][] table, String id){ for (int i=0; i<table.length; i++){ if (table[i] != null && table[i].length>0 && id.equalsIgnoreCase(table[i][0])) return i; } return -1; } private VoucherInfoFromOTUIDDB makeInfo(String[][] table, int row){ if (table == null || row>= table.length) return null; VoucherInfoFromOTUIDDB vi = new VoucherInfoFromOTUIDDB(); String[] line = table[0]; // cycle through first row to get field names for (int i = 1; i<line.length; i++) //start at 1 as we don't want to include the code vi.addElement(line[i]); line = table[row]; if (line == null || line.length == 0) return null; for (int i = 1; i<line.length; i++) //start at 1 as we don't want to include the code vi.setFieldValue(i-1, line[i]); //index is i-1 as we skipped over the first one return vi; } /*.................................................................................................................*/// String voucherID, String species, String latLong, String locality, String note, String collectionDate public VoucherInfoFromOTUIDDB getVoucherInfo(String databaseID, String id){ if (!handlesDatabase(databaseID)) return null; String path = getPath(databaseID); if (path == null) return null; int i = findPath(path); String[][] table = null; if (i<0){ table = MesquiteFile.getTabDelimitedTextFile(path, false); if (table != null){ paths.addElement(path); tables.addElement(table); } } else table = (String[][]) tables.elementAt(i); if (table == null) return null; int whichRow = findRow(table, id); if (whichRow<0) return null; return makeInfo(table, whichRow); } /*.................................................................................................................*/ public boolean handlesDatabase(String databaseID){ if (databaseID == null) return false; String which = getDBID(databaseID); return "tdt".equalsIgnoreCase(which); } /*.................................................................................................................*/ public String getName() { return "Voucher Info from Flexible Table"; } /*.................................................................................................................*/ public boolean isPrerelease(){ return false; } /*.................................................................................................................*/ /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ public int getVersionOfFirstRelease(){ return -1; } /*.................................................................................................................*/ /** returns whether this module is requesting to appear as a primary choice */ public boolean requestPrimaryChoice(){ return true; } /*.................................................................................................................*/ /** returns an explanation of what the module does.*/ public String getExplanation() { return "Supplies voucher information from a flexible tab-delimited table in a text file." ; }}
/* Mesquite source code. Copyright 2005 and onward, David Maddison and Wayne Maddison.Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out.Perhaps with your help we can be more than a few, and make Mesquite better.Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.Mesquite's web site is http://mesquiteproject.orgThis source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) */package mesquite.basic.VoucherInfoFromFlexTable; import mesquite.lib.*;import java.util.Vector;/* ======================================================================== */public class VoucherInfoFromFlexTable extends OTUIDCodeInfoSource { Vector tables, paths, lastModified; boolean warned = false; /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { paths = new Vector(); tables = new Vector(); lastModified = new Vector(); return true; } /*.................................................................................................................*/ private String getPath(String databaseID){ String where = null; if (databaseID.indexOf(":")<0) where = databaseID; else where = databaseID.substring(databaseID.indexOf(":")+1, databaseID.length()); if (!warned && StringUtil.blank(where)) { MesquiteMessage.warnProgrammer("Path of voucher info file is empty; databaseID = " + databaseID); warned = true; } return where; } /*.................................................................................................................*/ private String getDBID(String databaseID){ String which = null; if (databaseID.indexOf(":")<0) which = databaseID; else which = databaseID.substring(0, databaseID.indexOf(":")); if (!warned && StringUtil.blank(which)) { MesquiteMessage.warnProgrammer("DBID of voucher info file is empty; databaseID = " + databaseID); warned = true; } return which; } /** Looks in the paths Vector to see if it can find the path passed as an argument. If so, and if the last modified time of the file * at that path has not changed, then this method returns the index of the path. If so, but the last modified time of the file has changed, * then this method returns one less than the negative of the index. If no such path was found, the method returns MesquiteInteger.unassigned. */ private int findPath(String path){ if (path == null) return MesquiteInteger.unassigned; for (int i=0; i<paths.size(); i++) if (path.equals(paths.elementAt(i))) { MesquiteLong lastModifiedTime = (MesquiteLong)lastModified.elementAt(i); if (lastModifiedTime.getValue()!=MesquiteFile.fileOrDirectoryLastModified(path)) { // has been modified return -i-1; // return negative if i; subtract 1 so that 0 turns into -1 } return i; } return MesquiteInteger.unassigned; } private int findRow(String[][] table, String id){ for (int i=0; i<table.length; i++){ if (table[i] != null && table[i].length>0 && id.equalsIgnoreCase(table[i][0])) return i; } return -1; } private VoucherInfoFromOTUIDDB makeInfo(String[][] table, int row){ if (table == null || row>= table.length) return null; VoucherInfoFromOTUIDDB vi = new VoucherInfoFromOTUIDDB(); String[] line = table[0]; // cycle through first row to get field names for (int i = 1; i<line.length; i++) //start at 1 as we don't want to include the code vi.addElement(line[i]); line = table[row]; if (line == null || line.length == 0) return null; for (int i = 1; i<line.length; i++) //start at 1 as we don't want to include the code vi.setFieldValue(i-1, line[i]); //index is i-1 as we skipped over the first one return vi; } /*.................................................................................................................*/// String voucherID, String species, String latLong, String locality, String note, String collectionDate public VoucherInfoFromOTUIDDB getVoucherInfo(String databaseID, String id){ if (!handlesDatabase(databaseID)) return null; String path = getPath(databaseID); if (path == null) return null; int i = findPath(path); String[][] table = null; if (i==MesquiteInteger.unassigned){ // didn't find it table = MesquiteFile.getTabDelimitedTextFile(path, false); if (table != null){ paths.addElement(path); tables.addElement(table); lastModified.addElement(new MesquiteLong(MesquiteFile.fileOrDirectoryLastModified(path))); // store last modified } } else if (i<0) { // did find it, but last modified date has changed. table = MesquiteFile.getTabDelimitedTextFile(path, false); if (table != null){ i=-i-1; // need to take negative and subract 1 tables.setElementAt(table, i); lastModified.setElementAt(new MesquiteLong(MesquiteFile.fileOrDirectoryLastModified(path)), i); // reset last modified } } else table = (String[][]) tables.elementAt(i); if (table == null) return null; int whichRow = findRow(table, id); if (whichRow<0) return null; return makeInfo(table, whichRow); } /*.................................................................................................................*/ public boolean handlesDatabase(String databaseID){ if (databaseID == null) return false; String which = getDBID(databaseID); return "tdt".equalsIgnoreCase(which); } /*.................................................................................................................*/ public String getName() { return "Voucher Info from Flexible Table"; } /*.................................................................................................................*/ public boolean isPrerelease(){ return false; } /*.................................................................................................................*/ /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ public int getVersionOfFirstRelease(){ return -1; } /*.................................................................................................................*/ /** returns whether this module is requesting to appear as a primary choice */ public boolean requestPrimaryChoice(){ return true; } /*.................................................................................................................*/ /** returns an explanation of what the module does.*/ public String getExplanation() { return "Supplies voucher information from a flexible tab-delimited table in a text file." ; }}
Expand Down
Loading

0 comments on commit 36c9efa

Please sign in to comment.