[Phylobase-commits] r194 - branches/pdcgsoc/misc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 9 07:45:59 CEST 2008


Author: pdc
Date: 2008-07-09 07:45:59 +0200 (Wed, 09 Jul 2008)
New Revision: 194

Modified:
   branches/pdcgsoc/misc/temp.R
Log:
remove scratch functions

Modified: branches/pdcgsoc/misc/temp.R
===================================================================
--- branches/pdcgsoc/misc/temp.R	2008-07-09 05:40:24 UTC (rev 193)
+++ branches/pdcgsoc/misc/temp.R	2008-07-09 05:45:59 UTC (rev 194)
@@ -8,7 +8,8 @@
         xxyy <- unrootxxyy(phy)
     }
     
-    edges <- edgechar(phy, params) ## TODO do these parameters even require a whole fun?
+    ## TODO do these parameters even require a whole fun?
+    edges <- edgechar(phy, params) 
     
     tipplots <- tipPlot(...)
     
@@ -26,7 +27,8 @@
     pushViewport(viewport(
         x = 0.5, y = 0.5, 
         width = 0.8, height = 0.8, 
-        layout = treelayout, name = 'treelayout', angle = -rot)) # rotataion set here
+        # rotataion set here
+        layout = treelayout, name = 'treelayout', angle = -rot))
     
     if (show.tip.label) {
         pushViewport(viewport(
@@ -56,56 +58,6 @@
 
 }
 
-####################################################    
-    scratchYY <- function(phy, tip.order = NULL) {
-        yy <- rep(NA, nrow(phy at edge))
-        if(!is.null(tip.order)) { ## TODO do we need to acount for line weight when plotting close to edges?
-            yy[which(phy at edge[, 2] == tip.order)] <- seq(0, 1, length.out = length(phy at tip.label)) ## TODO perhaps we want to use match here?
-        } else {
-            phy <- reorder.phylo4(phy)
-            yy[phy at edge[, 2] <= length(phy at tip.label)] <- seq(0, 1, length.out = length(phy at tip.label)) 
-        }
-    
-        calc.node.y <- function(x, phy, yy) {
-            # recursive
-            if(any(phy at edge[, 2] == x) == FALSE) {
-                decdex <- which(phy at edge[, 1] == x)
-                index <- 0 ## TODO hackish!
-            } else {
-                index <- which(phy at edge[, 2] == x)
-                if(!is.na(yy[index])) { return(yy) }
-                decdex <- which(phy at edge[, 1] == phy at edge[index, 2])
-            }
-            for(i in phy at edge[decdex, 2]) {
-                yy <- calc.node.y(i, phy, yy)
-            }
-            yy[index] <- mean(yy[decdex])
-            yy
-        }
-        yy <- calc.node.y(length(phy at tip.label) + 1, phy, yy)
-        yy
-####################################################
-    }
-
-    scratchXX <- function(phy) {
-        ## xx <- rep(NA, nrow(phy at edge))
-        calc.node.x <- function(node, phy, xx = numeric(nrow(phy at edge)), prevx = NULL) {
-            ## recursive
-            index <- which(phy at edge[, 2] == node)
-            if(length(index) == 0) {
-                newx <- 0
-            } else {
-                xx[index] <- phy at edge.length[index] + prevx
-                newx <- xx[index]
-            }
-            for(i in phy at edge[phy at edge[, 1] == node, 2]) {
-                xx <- calc.node.x(i, phy, xx, newx)
-            }
-            xx
-        }
-        calc.node.x(length(phy at tip.label) + 1, phy)
-    }
-
 phyloXXYY <- function(phy, tip.order = NULL) {
     xxyy = list(
         yy = rep(NA, nrow(phy at edge)), 
@@ -113,8 +65,11 @@
         traverse = NULL) 
     
     ## TODO tip ordering should be dealt with at a higher level
-    ## if(!is.null(tip.order)) { ## TODO do we need to acount for line weight when plotting close to edges?
-    ##     yy[which(phy at edge[, 2] == tip.order)] <- seq(0, 1, length.out = length(phy at tip.label)) ## TODO perhaps we want to use match here?
+    ## if(!is.null(tip.order)) { 
+        ## TODO do we need to acount for line weight when plotting close to edges?
+    ##     yy[which(phy at edge[, 2] == tip.order)] <- seq(
+        ## TODO perhaps we want to use match here?
+        ## 0, 1, length.out = length(phy at tip.label)) 
     ## } else {
         phy <- reorder.phylo4(phy)
         xxyy$yy[phy at edge[, 2] <= length(phy at tip.label)] <- seq(



More information about the Phylobase-commits mailing list