[Rmesquite-commits] r8 - in pkg: . R man src src/mesquite src/mesquite/R src/mesquite/R/RCallsMesquite src/mesquite/R/RCallsMesquite/DoneEditAssistant src/mesquite/R/RCallsMesquite/lib src/mesquite/R/common src/org src/org/rosuda src/org/rosuda/JRI

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 18 05:08:50 CET 2009


Author: hlapp
Date: 2009-12-18 05:08:49 +0100 (Fri, 18 Dec 2009)
New Revision: 8

Added:
   pkg/R/utilities.R
   pkg/build.properties.example
   pkg/build.xml
   pkg/man/ancestralStatesCategorical.rd
   pkg/man/editTree.rd
   pkg/man/getMatrixInWindow.rd
   pkg/man/getTreeInWindow.rd
   pkg/man/showTree.rd
   pkg/man/startMesquite.Rd
   pkg/man/stopMesquite.rd
   pkg/src/
   pkg/src/mesquite/
   pkg/src/mesquite/R/
   pkg/src/mesquite/R/RCallsMesquite/
   pkg/src/mesquite/R/RCallsMesquite/DoneEditAssistant/
   pkg/src/mesquite/R/RCallsMesquite/DoneEditAssistant/DoneEditAssistant.java
   pkg/src/mesquite/R/RCallsMesquite/DoneEditAssistant/example.txt
   pkg/src/mesquite/R/RCallsMesquite/lib/
   pkg/src/mesquite/R/RCallsMesquite/lib/MesquiteRunner.java
   pkg/src/mesquite/R/common/
   pkg/src/mesquite/R/common/APETree.java
   pkg/src/mesquite/R/common/RCharacterData.java
   pkg/src/mesquite/R/common/RNumericMatrix.java
   pkg/src/mesquite/R/common/RPackageInterface.java
   pkg/src/org/
   pkg/src/org/rosuda/
   pkg/src/org/rosuda/JRI.zip
   pkg/src/org/rosuda/JRI/
   pkg/src/org/rosuda/JRI/Mutex.java
   pkg/src/org/rosuda/JRI/RBool.java
   pkg/src/org/rosuda/JRI/RConsoleOutputStream.java
   pkg/src/org/rosuda/JRI/REXP.java
   pkg/src/org/rosuda/JRI/RFactor.java
   pkg/src/org/rosuda/JRI/RList.java
   pkg/src/org/rosuda/JRI/RMainLoopCallbacks.java
   pkg/src/org/rosuda/JRI/RVector.java
   pkg/src/org/rosuda/JRI/Rengine.java
Modified:
   pkg/DESCRIPTION
   pkg/R/analysis.R
   pkg/R/mesquite.R
   pkg/R/objects.R
   pkg/R/zzz.R
   pkg/TODO.txt
   pkg/man/Rmesquite-package.Rd
Log:
Moving over sources from Wayne Maddisons RMesquite clone. All changes being
committed here are credit to Wayne Maddison.


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/DESCRIPTION	2009-12-18 04:08:49 UTC (rev 8)
@@ -1,6 +1,6 @@
 Package: RMesquite
-Version: 0.1-1
-Date: 2007-12-11
+Version: 0.5
+Date: 2009-12-03
 Title: Wrapper for Mesquite methods in R
 Author: Hilmar Lapp <hlapp at gmx.net>, and Wayne Maddison <wmaddisn at interchange.ubc.ca>.
 Maintainer: Hilmar Lapp <hlapp at gmx.net>
@@ -11,3 +11,5 @@
     Java. Mesquite is available from http://mesquiteproject.org.
 License: GPL (>= 2)
 URL: http://phyloc.r-forge.r-project.org, http://mesquiteproject.org
+Packaged: 2009-12-03; wmaddisn
+

Modified: pkg/R/analysis.R
===================================================================
--- pkg/R/analysis.R	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/R/analysis.R	2009-12-18 04:08:49 UTC (rev 8)
@@ -1,17 +1,21 @@
 #========================== Calling Analyses in Mesquite =====================
+# NOTE: most of these can be called with either headless or GUI Mesquite; some only with GUI
 
 # ==== Calls a Mesquite module that returns values for a tree and
 # character.  Requires that the module be of java subclass
 # NumberForTreeAndCharacter. Does NOT require that the module has already been
 # started.  However, this means that a module is started for each
 # request.
+# NOTE: perhaps we should pass a boolean to Mesquite to indicate whether it is to shut down the module, or return it for reuse
+# Returning it would require Mesquite to pass back a more complex object consisting of result + module
 mesquiteApply.TreeAndCategChar <- function(mesquite=.mesquite(),
                                            module,
+                                           dutyClass,
                                            tree,
                                            categMatrix,
                                            charIndex=1,
                                            runnerMethod,
-                                           returnType="mesquite.rmLink.common.RNumericMatrix",
+                                           returnType="mesquite.R.lib.RNumericMatrix",
                                            castMatrixType=NULL,
                                            taxaBlock=NULL,
                                            module.script=NULL) {
@@ -31,6 +35,11 @@
     module <- startMesquiteModule(module,script=module.script);
     need.stop <- TRUE;
   }
+  else if (is.character(dutyClass)) {
+    constraint <- .jcast(categMatrix,new.class="java/lang/Object")
+    module <- startMesquiteModuleOfDutyClass(dutyClass = dutyClass, constraint = constraint);
+    need.stop <- TRUE;
+  }
   if (length(grep("\\.",returnType)) > 0) {
     returnType <- paste("L",gsub("\\.","/",returnType),";",sep="");
   }
@@ -85,6 +94,24 @@
                                  module.script=module.script);
 }
 
+#====  Calls a Mesquite function that calculates a number for a character and tree; Mesquite chooses which  
+# TO BE CALLED ONLY WITH GUI MESQUITE
+evaluateTreeAndCharacter <-  function(tree,
+                             categMatrix,
+                             charIndex=1,
+                             taxaBlock=NULL,
+                             script=NULL){
+  result <- mesquiteApply.TreeAndCategChar(module=NULL,
+  										   dutyClass = "mesquite.lib.duties.NumberForCharAndTree",
+                                           tree=tree,
+                                           categMatrix=categMatrix,
+                                           charIndex=charIndex,
+                                           taxaBlock=taxaBlock,
+                                           runnerMethod="numberForTreeAndCharacter",
+                                           castMatrixType="mesquite/lib/characters/CharacterData",
+                                           module.script=script);
+  result
+}
 #====  Calls Mesquite's BiSSE likelihood function.  
 bisseLikelihood <-  function(tree,
                              categMatrix,

Modified: pkg/R/mesquite.R
===================================================================
--- pkg/R/mesquite.R	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/R/mesquite.R	2009-12-18 04:08:49 UTC (rev 8)
@@ -1,7 +1,12 @@
 #========================== Basic Mesquite functions =========================
 
 #==== Trying to determine the location of Mesquite
-mesquite.classpath <- function() {
+#Behaviour should be (but isn't yet) as follows:
+# If headless is not specified, then look to <mesquitePath> in the preferences file.  
+#      If this mesquitePath is blank, then use mesquiteHeadlessPath instead
+# If headless is false, then use mesquitePath
+# otherwise use mesquiteHeadlessPath 
+mesquite.classpath <- function(headless = FALSE) {
   # default location is $HOME/Mesquite_Support_Files
   home.dir <- if (.Platform$OS.type == "windows")
     Sys.getenv("HOMEPATH") else Sys.getenv("HOME");
@@ -9,12 +14,12 @@
                            .Platform$file.sep,"Mesquite_Support_Files",
                            .Platform$file.sep,"Mesquite_Prefs",
                            sep="");
-  # for now the only place we have to look into is the Mesquite log,
-  # so it has to have been fired up at least once, and it must have
-  # been the headless version that was fired up last.
+  # for now the only place we have to look into is the Mesquite preferences file,
+  # so it has to have been fired up at least once.
   con <- file(paste(mesqu.prefs.dir,.Platform$file.sep,"Mesquite.xml",sep=""),
               open="r");
   l <- readLines(con,n=1);
+  if (headless){
   while((length(l) > 0) && (length(grep("<mesquiteHeadlessPath>",l)) == 0)) {
     l <- readLines(con,n=1);
   }
@@ -25,22 +30,55 @@
              l);
     return(sub("\\./","",p));
   }
+  }
+  else {
+   while((length(l) > 0) && (length(grep("<mesquitePath>",l)) == 0)) {
+    l <- readLines(con,n=1);
+  }
+  close(con);
+  if (length(l) > 0) {
+    p <- sub(".*<mesquitePath>([^<]+)</mesquitePath>.*",
+             "\\1",
+             l);
+    return(sub("\\./","",p));
+  }
+  }
   character(0);
 }
 
-# ==== Starts up Mesquite.  Expensive; should be done once before
+
+# ==== Starts up Mesquite.  Expensive; should be done once before 
 # calling Mesquite functions.
-startMesquite <- function(cp){
-  if (missing(cp)) {
-    cp <- mesquite.classpath();
+startMesquite <- function(cp, showWindows = TRUE, headless = FALSE){
+  	assign(".mesquite.GUIAvailable",showWindows && !headless,pos="package:RMesquite");
+  if (!headless && !(exists(".jgr.works") && .jgr.works) && (.Platform$OS.type == "unix" && system("uname",intern=TRUE) == "Darwin")){
+ 	print("If the version of Mesquite you are attempting to start is the normal graphical version, this command will not work. On Mac OS X, you cannot run the graphical version of Mesquite when running R from the normal GUI R app or the Terminal.  You need to use JGR to run R, or you need to use the headless version of Mesquite."); 
+  
   }
-  if ((!is.null(cp)) && length(cp) > 0) {
-    .jaddClassPath(cp);
+  if (is.null(.mesquite.Runner)) {
+ 	 if (missing(cp)) {
+ 	   cp <- mesquite.classpath(headless);
+ 	 }
+ 	 if ((!is.null(cp)) && length(cp) > 0) {
+  	  .jaddClassPath(cp);
+  	}
+ 	# .jpackage("mesquite.R")
+  	print("Starting Mesquite.  If any problems arise please see help file or http://mesquiteproject.org/packages/Mesquite.R/RMesquite.html");
+  	print(cp);
+  	tryCatch ({
+  	mesquite.Runner <- .jnew("mesquite/R/RCallsMesquite/lib/MesquiteRunner")
+  	}, finally = {
+  	if (is.null(mesquite.Runner)) print("NOTE: Make sure you have started a copy of Mesquite previously, and that the last copy started has Mesquite.R installed.  Also, if using Mac OS X, either use JGR for running R, or use a headless version of Mesquite.")
+  	});
+  	assign(".mesquite.Runner",mesquite.Runner,pos="package:RMesquite");
+
+	invisible(.jcall(mesquite.Runner, "Lmesquite/Mesquite;", "startMesquite", showWindows));
+		
   }
-  mesquite.Runner <- .jnew("mesquite/rmLink/rCallsM/MesquiteRunner");
-  assign(".mesquite.Runner",mesquite.Runner,pos="package:RMesquite");
-  invisible(.jcall(mesquite.Runner, "Lmesquite/Mesquite;", "startMesquite"));
-}
+  else {
+  	print("Mesquite already started");
+  }
+ }
 
 # ==== Returns the passed variable if provided and not null, and
 # otherwise returns the cached instance of the Mesquite runner
@@ -51,6 +89,14 @@
     mesquite;
 }
 
+# ==== Stops Mesquite 
+stopMesquite <- function(){
+  .jcall(.mesquite(),
+                   "V",
+                   "stopMesquite");
+  assign(".mesquite.Runner",NULL,pos="package:RMesquite");
+}
+
 # ==== Starts Mesquite module of given class.  E.g.,
 # mesquite.diverse.BiSSELikelihood should be indicated by
 # #BiSSELikelihood or #mesquite.diverse.BiSSELikelihood. This module
@@ -68,6 +114,18 @@
                    script);
   module
 }
+# ==== Starts Mesquite module of given duty class.  E.g.,
+# a number for character and tree should be indicated by
+# "NumberForCharAndTree". This module
+# itself may hire other modules and so forth. 
+# The expectation is that Mesquite's UI will decide what module to hire
+startMesquiteModuleOfDutyClass <- function(dutyClass, constraint){
+  module <- .jcall(.mesquite(),
+                   "Lmesquite/lib/MesquiteModule;",
+                   "startModuleOfDutyClass",
+                   dutyClass, constraint);
+  module
+}
 
 # ==== Stops Mesquite module.  Should be called when a module is no
 # longer needed.
@@ -125,3 +183,13 @@
 	cat(c,sep="\n")
 }
 
+#==== Sets Mesquite to interactive mode
+setInteractive <- function(interactive){
+  com <- .jcall(.mesquite(),
+				"V", 
+				"setInteractive",
+				interactive);
+
+  com
+}
+

Modified: pkg/R/objects.R
===================================================================
--- pkg/R/objects.R	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/R/objects.R	2009-12-18 04:08:49 UTC (rev 8)
@@ -146,13 +146,16 @@
   if (class(obj) != "jobjRef") {
     stop("need to pass java object reference, not ",class(obj));
   }
-  charM <- .jnew("mesquite/rmLink/common/RCharacterData",
+  charM <- .jnew("mesquite/R/common/RCharacterData",
                  .jcast(obj,"mesquite/lib/characters/CharacterData"));
   col.names <- .jcall(charM, "[Ljava/lang/String;","getColumnNames");
   row.names <- .jcall(charM, "[Ljava/lang/String;","getRowNames");
   states <- vector();
   if (class.name == "ContinuousData") {
     states <- .jcall(charM, "[D","asDoubleMatrix");
+  } 
+   else if (class.name == "MeristicData") {
+    states <- .jcall(charM, "[D","asDoubleMatrix");
   } else {
     states <- .jcall(charM, "[Ljava/lang/String;","asStringMatrix");
   }
@@ -174,7 +177,7 @@
   if (cl.name == "RNumericMatrix") {
     return(from.RNumericMatrix(from));
   }
-  if (cl.name %in% c("CategoricalData","ContinuousData","DNAData")) {
+  if (cl.name %in% c("CategoricalData","ContinuousData","DNAData","MeristicData")) {
     return(from.CharacterMatrix(from,class.name=cl.name));
   }
   stop("currently not supported for objects of class ",.jclassOf(from));
@@ -187,7 +190,7 @@
   mRoot <- .jcall(from,"I","getRoot");
   numNodes <- .jcall(from,"I","numberOfNodesInClade",mRoot);
   numTerminals <- .jcall(from,"I","numberOfTerminalsInClade",mRoot);
-  mAPE <- .jnew("mesquite/rmLink/common/APETree",
+  mAPE <- .jnew("mesquite/R/common/APETree",
                 .jcast(from,"mesquite/lib/Tree"));
   edge.matrix <- .jcall(mAPE,"[[I","getEdgeMatrix");
   phylo <- list(edge=matrix(
@@ -214,7 +217,7 @@
 ##           mRoot <- .jcall(from,"I","getRoot");
 ##           numNodes <- .jcall(from,"I","numberOfNodesInClade",mRoot);
 ##           numTerminals <- .jcall(from,"I","numberOfTerminalsInClade",mRoot);
-##           mAPE <- .jnew("mesquite/rmLink/common/APETree",
+##           mAPE <- .jnew("mesquite/R/common/APETree",
 ##                         .jcast(from,"mesquite/lib/Tree"));
 ##           edge.matrix <- .jcall(trApe,"[[I","getEdgeMatrix");
 ##           phylo4(edge=matrix(

Added: pkg/R/utilities.R
===================================================================
--- pkg/R/utilities.R	                        (rev 0)
+++ pkg/R/utilities.R	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,44 @@
+#==== Shows tree in Mesquite to be edited by hand.  Accepts either phylo or MesquiteTree, and
+# returns same type as given
+editTree <- function(tree){
+  	if (!.mesquite.GUIAvailable){
+  		print("To show a tree, you need to have called startMesquite requesting the graphical version of Mesquite.");
+  	}
+  	else {
+	wasMesquiteTree = TRUE;
+  	if (class(tree) != "jobjRef") {
+   	 tree <- mesquiteTree(tree=tree);
+   	 wasMesquiteTree = FALSE;
+  	}
+	returnedTree <- .jcall(.mesquite(), "Lmesquite/lib/MesquiteTree;", "editTree", tree);
+	if (!wasMesquiteTree)
+		returnedTree <- as.phylo(returnedTree)
+	returnedTree
+	}
+}
+
+#==== Shows tree in Mesquite.  Reuses previously used window if available
+showTree <- function(tree){
+  	if (!.mesquite.GUIAvailable){
+  		print("To show a tree, you need to have called startMesquite requesting the graphical version of Mesquite.");
+  	}
+  	else {
+  	if (class(tree) != "jobjRef") {
+   	 	tree <- mesquiteTree(tree=tree);
+   	 }
+	.jcall(.mesquite(), "V", "showTree", tree);
+	}
+}
+
+
+#==== Gets tree in Tree Window in Mesquite that is in the foreground
+getTreeInWindow <- function(){
+	returnedTree <- .jcall(.mesquite(), "Lmesquite/lib/MesquiteTree;", "getTreeInWindow");
+	returnedTree
+}
+
+#==== Gets matrix in Character Matrix Editor window in Mesquite that is in the foreground
+getMatrixInWindow <- function(){
+	returnedMatrix <- .jcall(.mesquite(), "Lmesquite/lib/characters/CharacterData;", "getMatrixInWindow");
+	returnedMatrix
+}

Modified: pkg/R/zzz.R
===================================================================
--- pkg/R/zzz.R	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/R/zzz.R	2009-12-18 04:08:49 UTC (rev 8)
@@ -1,7 +1,9 @@
 .First.lib <- function(lib,pkg) {
   require(rJava);
+  require(ape);
+  assign(".mesquite.Runner",NULL,pos="package:RMesquite");
   op <- options();
-  options(java.parameters=c("-Djava.awt.headless=true",op$java.parameters));
+  options(java.parameters=c("",op$java.parameters));
   .jpackage(pkg);
   options(op); # restore what we found
 }

Modified: pkg/TODO.txt
===================================================================
--- pkg/TODO.txt	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/TODO.txt	2009-12-18 04:08:49 UTC (rev 8)
@@ -1,4 +1,4 @@
-In RMLink:
+In RLink:
 ==========
 
 * Expose directory methods in Mesquite to R (for example, list all
@@ -23,3 +23,35 @@
 ** Should be done, but needs testing.
 
 * Method to convert state matrix from Java to R
+
+
+
+To build, cd into workspace directory.  Then:  sudo R CMD INSTALL RMesquite
+
+
+
+#run this script, e.g. using source("~/example.txt")
+
+mer <- getMatrixInWindow()
+rmer <- as.matrix(mer)
+
+library(RMesquite)
+startMesquite()
+data(bird.families)
+birds <- mesquiteTree(tree = bird.families)
+
+birds2 <- editTree(birds)
+tree.returned <- as.phylo(birds2)
+
+plot(tree.returned)
+tree.tosend <- as.phylo(birds)
+plot(tree.tosend)
+========
+
+library(RMesquite)
+startMesquite()
+tree <- getTreeInWindow()
+tp <- as.phylo(tree)
+matrix <- getMatrixInWindow()
+m <- as.matrix(matrix)
+a <- ancestralStatesCategorical(tp, m, method="ML", charIndex=1)
\ No newline at end of file

Added: pkg/build.properties.example
===================================================================
--- pkg/build.properties.example	                        (rev 0)
+++ pkg/build.properties.example	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,21 @@
+#######################################################################
+# Ant build properties for RMesquite.
+#
+# In order for this file to take effect, you will need to create a
+# copy of it under the name build.properties, and change according to
+# your local setup.
+#######################################################################
+
+#
+# Where is Mesquite installed? This is the root directory of the
+# Mesquite installation.
+#
+mesquite.home = /Applications/Mesquite_Folder
+# Windows?
+# mesquite.home = C\:\\Program Files\\Mesquite_Folder
+
+#
+# Where should the jar be copied for deployment?
+#
+deploy.dir = /path/to/where/to/deploy/jarFile
+# deploy.dir = /Users/lapp/Devel/phyloc/trunk/Rpkgs/RMesquite/inst/java

Added: pkg/build.xml
===================================================================
--- pkg/build.xml	                        (rev 0)
+++ pkg/build.xml	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+
+<!--
+
+    This is the ant build file for the Mesquite.R Java package for 
+    R<->Mesquite interaction.
+
+-->
+
+<project name="Mesquite.R" default="jar">
+
+  <!--
+
+      ############################################################
+      Properties section
+      ############################################################
+
+    -->
+
+  <!-- additional local properties for this build -->
+  <property file="build.properties"/>
+
+  <!-- project info -->
+  <property name="project" value="Mesquite.R"/>
+  <property name="version.number" value="0.0.3"/>
+
+  <!-- distribution -->
+  <property name="dist.name" value="${project}-${version.number}"/>
+
+  <!-- directories -->
+  <property name="dir.build" value="build"/>
+  <property name="dir.build.classes" value="${dir.build}/classes"/>
+  <property name="dir.src" value="Source"/>
+  <property name="dir.lib" value="lib"/>
+  <property name="dir.doc" value="docs"/>
+  <property name="dir.apidoc" value="${dir.doc}/api"/>
+  <property name="dir.test" value="test"/>
+
+  <!-- files -->
+  <property name="file.jar" value="${dir.build}/${dist.name}.jar"/>
+
+  <!-- deployment -->
+  <property name="dir.deploy" value="deploy"/>
+  <property name="R.package" value="RMesquite"/>
+
+  <!-- paths and sets of files -->
+  <patternset id="file.list.RtoM">
+    <include name="mesquite/R/lib/**/*"/>
+  </patternset>
+  <patternset id="file.list.MtoR">
+    <include name="mesquite/R/lib/**/*"/>
+  </patternset>
+
+  <!-- classes: -->
+  <fileset dir="${dir.build.classes}" id="classfiles.RtoM">
+    <patternset refid="file.list.RtoM"/>
+    <filename name="**/*.class"/>
+  </fileset>
+  <fileset dir="${dir.build.classes}" id="classfiles.MtoR">
+    <patternset refid="file.list.MtoR"/>
+    <filename name="**/*.class"/>
+  </fileset>
+
+  <!-- additional elements for classpath -->
+  <path id="my.classpath">
+    <pathelement path="${mesquite.home}"/>
+  </path>
+
+  <!--
+
+      ############################################################
+      Target section
+      ############################################################
+
+    -->
+
+  <target name="init">
+    <tstamp>
+      <format property="TODAY.NOW" pattern="MMM d yyyy, hh:mm:ss"/>
+    </tstamp>
+    <echo message="Started build script for Mesquite.R ${TODAY.NOW}"/>
+  </target>
+
+  <!-- compile the source files -->
+  <target name="compile" depends="init" description="Compile sources.">
+    <mkdir dir="${dir.build}"/>
+    <mkdir dir="${dir.build.classes}"/>
+    <javac srcdir="${dir.src}"
+	   destdir="${dir.build.classes}"
+	   includeAntRuntime="false" debug="true" deprecation="true"
+	   >
+      <classpath><path refid="my.classpath"/></classpath>
+      <patternset refid="file.list.RtoM"/>
+      <filename name="**/*.java"/>
+    </javac>
+  </target>
+
+  <!-- build jar file -->
+  <target name="jar" depends="compile" description="Create jar file.">
+    <!-- jar it up -->
+    <jar jarfile="${file.jar}"
+	 basedir="${dir.build.classes}" compress="true"
+	 update="false">
+      <exclude name="**/*"/>
+      <fileset refid="classfiles.RtoM"/>
+      <manifest>
+        <attribute name="Built-By" value="${user.name}"/>
+      </manifest>
+    </jar>
+  </target>
+
+  <target name="rebuild" depends="clean,jar" description="Rebuild the jar.">
+    <echo message="Rebuild done."/>
+  </target>
+
+  <target name="javadoc" depends="init" description="Generate Javadoc.">
+    <mkdir dir="${dir.apidoc}"/>
+    <javadoc destdir="${dir.apidoc}"
+             windowtitle="${project} Javadoc Documentation"
+             doctitle="${project} Javadoc Documentation"
+             package="true" version="true" author="true">
+      <classpath>
+        <path refid="my.classpath"/>
+        <fileset dir="${dir.build}"><patternset refid="lib.jars"/></fileset>
+      </classpath>
+      <fileset refid="srcfiles"/>
+      <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
+    </javadoc>
+  </target>
+
+  <target name="clean" depends="init" description="Clean all build products.">
+    <delete>
+      <fileset dir="${dir.build.classes}"/>
+    </delete>
+    <delete file="${file.jar}"/>
+  </target>
+
+  <target name="deploy" depends="jar" 
+          description="Deploy jar file to destination">
+    <copy file="${file.jar}" todir="${deploy.dir}" 
+          flatten="true" preservelastmodified="true" verbose="true"/>
+  </target>
+
+  <target name="Rinstall" depends="deploy" 
+          description="Install the R package">
+    <exec executable="R" dir="${deploy.dir}/../../..">
+      <arg value="CMD"/>
+      <arg value="INSTALL"/>
+      <arg value="${R.package}"/>
+    </exec>
+  </target>
+
+</project>

Modified: pkg/man/Rmesquite-package.Rd
===================================================================
--- pkg/man/Rmesquite-package.Rd	2009-12-18 04:04:46 UTC (rev 7)
+++ pkg/man/Rmesquite-package.Rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -7,20 +7,35 @@
 }
 \description{
   The RMesquite package provides transparent access to data types and
-  analysis modules in Mesquite. Mesquite is a modular system for
-  evolutionary analysis in Java. Mesquite is available from
-  http://mesquiteproject.org.
+  analysis modules in Mesquite, and to some of Mesquite\'s graphical functions. Mesquite is a modular system for
+  evolutionary analysis in Java (http://mesquiteproject.org).  
 }
 \details{
+  To use RMesquite, Mesquite version 2.72 or later must also be installed on your computer, and the package Mesquite.R 
+must be installed in Mesquite. To install Mesquite.R in Mesquite, start Mesquite, 
+go to the menu item \"Check Now for Notices/Updates\" in the File menu, and enter the URL 
+http://mesquiteproject.org/packages/Mesquite.R/installOSX.xml for Mac OS X,
+http://mesquiteproject.org/packages/Mesquite.R/installWindows.xml for Windows,
+and http://mesquiteproject.org/packages/Mesquite.R/installLinux.xml for Linux. 
+The Mesquite.R package of modules in Mesquite also enables Mesquite to call functions in R.
+\cr\cr
+Headless versus Graphical Mesquite: Mesquite can be called from R either in its normal graphical version, 
+or as a headless version. If you want to have access to Mesquite\'s windows, 
+you need to use its graphical version. If you want to use only non-graphical calculations 
+in Mesquite, you can use either version. Mac OS X Users: you cannot call the graphical 
+version of Mesquite from the normal \"GUI\" R application or from the Terminal for reasons outside of our control. 
+If you want to use the graphical version of Mesquite from R, 
+you need to use instead the alternative JGR application for running R.\cr
 \tabular{ll}{
 Package: \tab RMesquite\cr
 Type: \tab Package\cr
-Version: \tab 0.1\cr
-Date: \tab 2007-12-11\cr
+Version: \tab 0.5\cr
+Date: \tab 2009-12-04\cr
 License: \tab GPLv2.0 or later\cr
 }
-~~ An overview of how to use the package, including the most ~~
-~~ important functions ~~
+
+
+
 }
 \author{
 Hilmar Lapp (hlapp at gmx.net) and Wayne Maddison (wmaddisn at interchange.ubc.ca)
@@ -28,15 +43,18 @@
 Maintainer: Hilmar Lapp <hlapp at gmx.net>
 }
 \references{
-~~ Literature or other references for background information ~~
+RMesquite web page: http://mesquiteproject.org/packages/Mesquite.R/RMesquite.html\cr
+Mesquite.R web page: http://mesquiteproject.org/packages/Mesquite.R/index.html\cr
+Maddison, W. P. and D.R. Maddison. 2009. Mesquite: a modular system for 
+     evolutionary analysis.  Version 2.72  http://mesquiteproject.org
 }
-~~ Optionally other standard keywords, one per line, from file ~~
-~~ KEYWORDS in the R documentation directory ~~
 \keyword{ package }
 \seealso{
-~~ Optional links to other man pages, e.g. ~~
-~~ \code{\link[<pkg>:<pkg>-package]{<pkg>}} ~~
+
 }
 \examples{
-%% ~~ simple examples of the most important functions ~~
+#To use Mesquite from R, you will need to start up Mesquite by calling startMesquite().
+
+library(RMesquite)
+startMesquite()
 }

Added: pkg/man/ancestralStatesCategorical.rd
===================================================================
--- pkg/man/ancestralStatesCategorical.rd	                        (rev 0)
+++ pkg/man/ancestralStatesCategorical.rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,65 @@
+\name{ancestralStatesCategorical}
+\Rdversion{1.1}
+\alias{ancestralStatesCategorical}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Reconstruct ancestral states
+}
+\description{
+Reconstructs ancestral states for a character on a phylogenetic tree
+}
+\usage{
+ancestralStatesCategorical(tree, categMatrix, method = "ML", charIndex = 1, taxaBlock = NULL, script = NULL)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{tree}{
+ A phylogenetic tree, either an object of type phylo, or a MesquiteTree java object.
+}
+  \item{categMatrix}{
+ A categorical character matrix, either an R matrix or a CategoricalData java object.
+}
+  \item{method}{
+method = "ML" for maximum likelihood, "parsimony" for parsimony.
+}
+  \item{charIndex}{
+ which character of the matrix to use.
+}
+  \item{taxaBlock}{
+ which taxa block to use; if null Mesquite will make a taxa block based on the tree.
+}
+  \item{script}{
+%%     ~~Describe \code{script} here~~
+}
+}
+\details{
+This function is not yet fully implemented.
+}
+\value{
+%%  ~Describe the value returned
+%%  If it is a LIST, use
+%%  \item{comp1 }{Description of 'comp1'}
+%%  \item{comp2 }{Description of 'comp2'}
+%% ...
+}
+\references{
+%% ~put references to the literature/web site here ~
+}
+\author{
+%%  ~~who you are~~
+}
+\note{
+%%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+%% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+\examples{
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ ~kwd1 }
+\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line

Added: pkg/man/editTree.rd
===================================================================
--- pkg/man/editTree.rd	                        (rev 0)
+++ pkg/man/editTree.rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,58 @@
+\name{editTree}
+\Rdversion{1.1}
+\alias{editTree}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Edit tree in Mesquite
+}
+\description{
+  Sends a phylogenetic tree to Mesquite for editing in Mesquite's graphical tree window.
+}
+\usage{
+editTree(tree)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{tree}{
+A tree either as a phylo object, or as a MesquiteTree java object.
+}
+}
+\details{
+Requires use of the normal (GUI) version of Mesquite (not the headless version).
+}
+\value{
+  Returns an edited version of the tree, of the same type as entered.
+}
+\references{
+%% ~put references to the literature/web site here ~
+}
+\author{
+%%  ~~who you are~~
+}
+\note{
+%%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+%% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+\examples{
+
+# library(RMesquite)
+# startMesquite()
+# data(bird.families)
+# tree <- bird.families
+# modifiedTree <- editTree(tree)
+
+# At this point, Mesquite will show a tree window with your tree.  
+# R will pause until you have edited the tree in Mesquite,
+# then hit the "Done" button in the tree window.  
+# Once you\'ve done that, the modified tree will be returned to R.
+}
+
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ ~kwd1 }
+\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line

Added: pkg/man/getMatrixInWindow.rd
===================================================================
--- pkg/man/getMatrixInWindow.rd	                        (rev 0)
+++ pkg/man/getMatrixInWindow.rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,47 @@
+\name{getMatrixInWindow}
+\Rdversion{1.1}
+\alias{getMatrixInWindow}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Get character matrix from Mesquite window
+}
+\description{
+Obtains the character matrix in the frontmost Character Matrix Editor window in Mesquite.
+}
+\usage{
+getMatrixInWindow()
+}
+%- maybe also 'usage' for other objects documented here.
+\details{
+For continuous and meristic matrices in Mesquite, missing data (?) and inapplicable codings (-) are 
+returned as NaN.  For three dimensional (multi item) matrices, only the first item is returned.  
+For categorical matrices, these are returned as the strings ? and -.  For categorical matrices, 
+polymorphisms and uncertainties are returned as a list of states, e.g. 0&2 and 0/2 are both returned as "0 2".
+}
+\value{
+Matrix is returned as a Mesquite matrix (e.g., ContinuousData object, or CategoricalData object).
+}
+\references{
+%% ~put references to the literature/web site here ~
+}
+\author{
+%%  ~~who you are~~
+}
+\note{
+%%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+%% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+\examples{
+# mesquiteMatrix <- getMatrixInWindow()
+# rMatrix <- as.matrix(mesquiteMatrix)
+
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ ~kwd1 }
+\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line

Added: pkg/man/getTreeInWindow.rd
===================================================================
--- pkg/man/getTreeInWindow.rd	                        (rev 0)
+++ pkg/man/getTreeInWindow.rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,46 @@
+\name{getTreeInWindow}
+\Rdversion{1.1}
+\alias{getTreeInWindow}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Get tree from Mesquite window
+}
+\description{
+Obtains the tree in the foremost tree window in Mesquite.
+}
+\usage{
+getTreeInWindow()
+}
+%- maybe also 'usage' for other objects documented here.
+\details{
+You can combined this with showTree(tree) to send a tree to Mesquite, 
+edit it and use it, then retrieve it in R.  An alternative but more restrictive way to edit
+a tree in Mesquite is to use editTree(tree)
+}
+\value{
+Returned as a MesquiteTree java object.
+}
+\references{
+%% ~put references to the literature/web site here ~
+}
+\author{
+%%  ~~who you are~~
+}
+\note{
+%%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+%% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+\examples{
+# mesquiteTree <- getTreeInWindow()
+# phyloTree <- as.phylo(mesquiteTree)
+
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ ~kwd1 }
+\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line

Added: pkg/man/showTree.rd
===================================================================
--- pkg/man/showTree.rd	                        (rev 0)
+++ pkg/man/showTree.rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,57 @@
+\name{showTree}
+\Rdversion{1.1}
+\alias{showTree}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Show tree in Mesquite window
+}
+\description{
+ Shows a phylogenetic tree in Mesquite's tree window. The tree may be analyzed, printed, and so on in Mesquite.
+ }
+\usage{
+showTree(tree)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{tree}{
+ A tree either as a phylo object or a MesquiteTree java object.
+}
+}
+\details{
+Requires use of the normal (GUI) version of Mesquite (not the headless version).
+}
+\value{
+%%  ~Describe the value returned
+%%  If it is a LIST, use
+%%  \item{comp1 }{Description of 'comp1'}
+%%  \item{comp2 }{Description of 'comp2'}
+%% ...
+}
+\references{
+%% ~put references to the literature/web site here ~
+}
+\author{
+%%  ~~who you are~~
+}
+\note{
+%%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+%% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+\examples{
+# Assume "tree" is an object of type phylo.
+
+# library(RMesquite)
+# startMesquite()
+# showTree(tree)
+
+# If desired, you can recover the tree later in R, if you\'ve modified it, using getTreeInWindow().
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ ~kwd1 }
+\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line

Added: pkg/man/startMesquite.Rd
===================================================================
--- pkg/man/startMesquite.Rd	                        (rev 0)
+++ pkg/man/startMesquite.Rd	2009-12-18 04:08:49 UTC (rev 8)
@@ -0,0 +1,86 @@
+\name{startMesquite}
+\Rdversion{1.1}
+\alias{startMesquite}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Start Mesquite
+}
+\description{
+Starts Mesquite.  Must be done before calling Mesquite's functions.
+
+}
+\usage{
+startMesquite(cp, showWindows = TRUE, headless = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{cp}{
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rmesquite -r 8


More information about the Rmesquite-commits mailing list