diff --git a/DESCRIPTION b/DESCRIPTION index 900c160..1cfc929 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: treespace Title: Statistical Exploration of Landscapes of Phylogenetic Trees -Date: 2023-04-03 -Version: 1.1.4.2 +Date: 2023-09-07 +Version: 1.1.4.3 Authors@R: c(TJ = person("Thibaut", "Jombart", email="thibautjombart@gmail.com", role = "aut", comment = c(ORCID = "0000-0003-2226-8692")), MK = person("Michelle", "Kendall", email="michelle.kendall@warwick.ac.uk", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7344-7071")), JAG = person("Jacob", "Almagro-Garcia", role = "aut", comment = c(ORCID = "0000-0002-0595-7333")), @@ -11,12 +11,12 @@ Description: Tools for the exploration of distributions of phylogenetic trees. treespaceServer(). For further details see Jombart et al. (2017) . Depends: R (>= 3.4.0), ape, ade4 -Imports: adegenet, adegraphics, adephylo, combinat, compiler, distory, +Imports: adegenet, adegraphics, combinat, compiler, distory, fields, htmlwidgets, MASS, methods, parallel, phangorn, phytools, Rcpp, rgl, RLumShiny, scatterD3, shiny, shinyBS, utils LinkingTo: Rcpp Suggests: ggplot2, igraph, knitr, pander, RColorBrewer, reshape2, - rmarkdown, testthat + rmarkdown, sf, testthat License: MIT + file LICENSE Encoding: UTF-8 LazyData: true diff --git a/NAMESPACE b/NAMESPACE index 2132e6f..05c5232 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -42,7 +42,6 @@ importFrom(adegraphics,insert) importFrom(adegraphics,s.class) importFrom(adegraphics,s.label) importFrom(adegraphics,s1d.barchart) -importFrom(adephylo,distTips) importFrom(combinat,combn) importFrom(combinat,combn2) importFrom(compiler,cmpfun) diff --git a/NEWS.md b/NEWS.md index e520f34..ed3062d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +treespace v1.1.4.3 +================== + +Patch to remove dependency on the `adephylo` package as required by CRAN - hopefully only temporarily. + treespace v1.1.4.2 ================== diff --git a/R/clusters.R~ b/R/clusters.R~ deleted file mode 100644 index 3335327..0000000 --- a/R/clusters.R~ +++ /dev/null @@ -1,52 +0,0 @@ -#' -#' Phylogenetic tree exploration -#' -#' This functions are under development. Please do not use them without contacting the author first. -#' -#' @param x an object of the class multiPhylo -#' @param method a function outputting the summary of a tree (phylo object) in the form of a vector -#' @param nf the number of principal components to retain -#' @param ... further arguments to be passed to \code{method} -#' -#' @author Thibaut Jombart \email{thibautjombart@@gmail.com}, Michelle Kendall \email{michelle.kendall@@bdi.ox.ac.uk}, Caroline Colijn \email{c.colijn@@imperial.ac.uk} -#' -#' @export -#' -#' @import ape -#' @importFrom ade4 dudi.pco -#' @importFrom adephylo distTips -#' -#' @examples -#' -#' ## generate list of trees -#' x <- rmtree(10, 20) -#' names(x) <- paste("tree", 1:10, sep = "") -#' -#' ## use treespace -#' res <- treespace(x, nf=3) -#' table.paint(as.matrix(res$D)) -#' scatter(res$pco) -#' -treespace <- function(x, method=tree.vec, nf=NULL, ...){ - ## CHECKS ## - if(!inherits(x, "multiPhylo")) stop("x should be a multiphylo object") - if(is.null(names(x))) names(x) <- 1:length(x) - lab <- names(x) - - - ## GET DISTANCES BETWEEN TREES ## - ## get data.frame of all summary vectors ## - df <- t(data.frame(lapply(x, function(e) as.vector(method(e, ...))))) - - ## get pairwise Euclidean distances ## - D <- dist(df) - attr(D,"Labels") <- lab # restore labels - - ## perform PCoA/MDS ## - pco <- dudi.pco(D, scannf=is.null(nf), nf=nf) - - - ## BUILD RESULT AND RETURN ## - out <- list(D=D, pco=pco) - return(out) -} # end treespace diff --git a/R/data.R~ b/R/data.R~ deleted file mode 100644 index 1e7e00f..0000000 --- a/R/data.R~ +++ /dev/null @@ -1,19 +0,0 @@ -##' Bootstrap trees from woodmouse dataset -##' -##' These trees were created using the neighbour-joining and bootstrapping -##' example from the ape documentation. -##' -##' -##' @name woodmiceTrees -##' @docType data -##' @format A multiPhylo object containing 201 trees, each with 15 tips -##' @references Michaux, J. R., Magnanou, E., Paradis, E., Nieberding, C. and -##' Libois, R. (2003) Mitochondrial phylogeography of the Woodmouse (Apodemus -##' sylvaticus) in the Western Palearctic region. \emph{Molecular Ecology}, 12, -##' 685-697 -##' @source A set of 15 sequences of the mitochondrial gene cytochrome b of the -##' woodmouse (Apodemus sylvaticus) which is a subset of the data analysed by -##' Michaux et al. (2003). The full data set is available through GenBank -##' (accession numbers AJ511877 to AJ511987) -##' @keywords datasets -NULL diff --git a/R/servers.R b/R/servers.R index a408db9..0e556e2 100644 --- a/R/servers.R +++ b/R/servers.R @@ -18,7 +18,7 @@ #' @importFrom adegraphics s1d.barchart #' @importFrom adegraphics s.class #' @importFrom adegraphics s.label -#' @importFrom adephylo distTips +#@importFrom adephylo distTips #' @importFrom distory dist.multiPhylo #' @importFrom fields rdist #' @importFrom htmlwidgets saveWidget diff --git a/R/treespace.R b/R/treespace.R index 163b35a..8ad3da7 100644 --- a/R/treespace.R +++ b/R/treespace.R @@ -28,7 +28,7 @@ #' #' @import ape #' @importFrom ade4 dudi.pco cailliez is.euclid -#' @importFrom adephylo distTips +#@importFrom adephylo distTips #' @importFrom distory dist.multiPhylo #' @importFrom fields rdist #' @importFrom phangorn KF.dist @@ -108,9 +108,10 @@ treespace <- function(x, method="treeVec", nf=NULL, lambda=0, return.tree.vector D <- as.dist(rdist(df)) } else if(method %in% c("Abouheif","sumDD")){ - df <- t(mcmapply(adephylo::distTips, x, method=method, MoreArgs=dots, mc.cores=processors)) + stop("Unfortunately, the methods of Abouheif and sumDD for summarising the tree as a vector are currently unavailable because of an issue with the package adephylo, on which they depend. Please select another method.") + #df <- t(mcmapply(adephylo::distTips, x, method=method, MoreArgs=dots, mc.cores=processors)) ## get pairwise Euclidean distances ## - D <- as.dist(rdist(df)) + #D <- as.dist(rdist(df)) } else if(method=="patristic"){ D <- path.dist(x, use.weight=TRUE) diff --git a/docs/404.html b/docs/404.html index a0d15b3..5d67d0e 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/CONDUCT.html b/docs/CONDUCT.html index d87a656..59af1d7 100644 --- a/docs/CONDUCT.html +++ b/docs/CONDUCT.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index e8da9e7..4bd517e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/articles/DengueVignette.html b/docs/articles/DengueVignette.html index 2ad13cb..34d4c57 100644 --- a/docs/articles/DengueVignette.html +++ b/docs/articles/DengueVignette.html @@ -33,7 +33,7 @@ treespace - 1.1.4.2 + 1.1.4.3 @@ -91,7 +91,7 @@

treespace worked example: Dengue trees

Michelle Kendall, Thibaut Jombart

-

2023-04-03

+

2023-09-07

Source: vignettes/DengueVignette.Rmd @@ -210,7 +210,7 @@

Using treespace to compare tr # simple plot: plotGrovesD3(Dscape$pco, groups=Dtype)
-

The function plotGrovesD3 produces interactive d3 plots +

The function plotGrovesD3 produces interactive d3 plots which enable zooming, moving, tooltip text and legend hovering. We now refine the plot with colour-blind friendly colours (selected using ColorBrewer2), bigger points, varying symbols and point opacity to demonstrate the NJ and ML trees, @@ -232,7 +232,7 @@

Using treespace to compare tr point_opacity=c(rep(0.4,400),1,1), legend_width=80)
-

We can also add tree labels to the plot. Where these overlap, the +

We can also add tree labels to the plot. Where these overlap, the user can use “drag and drop” to move them around for better visibility.

@@ -249,7 +249,7 @@ 

Using treespace to compare tr point_opacity=c(rep(0.4,400),1,1), legend_width=80)

-

Alternatively, where labels are too cluttered, it may be preferable +

Alternatively, where labels are too cluttered, it may be preferable not to plot them but to make the tree names available as tooltip text instead:

@@ -266,7 +266,7 @@ 

Using treespace to compare tr point_opacity=c(rep(0.4,400),1,1), legend_width=80)

-

The scree plot is available as part of the treespace +

The scree plot is available as part of the treespace output:

 barplot(Dscape$pco$eig, col="navy")
@@ -386,7 +386,7 @@

Using tre # simple plot: plotGrovesD3(BEASTscape$pco)
-

There appear to be clusters of tree topologies within the BEAST +

There appear to be clusters of tree topologies within the BEAST trees. We can use the function findGroves to identify clusters:

@@ -426,7 +426,7 @@ 

Using tre size_var = highlightTrees, legend_width=0)

-

To understand the differences between the representative trees we can +

To understand the differences between the representative trees we can use plotTreeDiff again, for example:

 # differences between the MCC tree and the median from the largest cluster:
diff --git a/docs/articles/TransmissionTreesVignette.html b/docs/articles/TransmissionTreesVignette.html
index b0b1bb1..dcad92e 100644
--- a/docs/articles/TransmissionTreesVignette.html
+++ b/docs/articles/TransmissionTreesVignette.html
@@ -33,7 +33,7 @@
       
       
         treespace
-        1.1.4.2
+        1.1.4.3
       
     
@@ -92,7 +92,7 @@

treespace worked example: Transmission

Michelle Kendall

-

2023-04-03

+

2023-09-07

Source: vignettes/TransmissionTreesVignette.Rmd @@ -158,15 +158,15 @@

ExamplesThis can be easily visualised as a transmission chain using graph plotting packages such as igraph or visNetwork:

-library(igraph)
+library(igraph)
 # set plotting options:
-igraph_options(vertex.size=15,
+igraph_options(vertex.size=15,
                vertex.color="cyan",
                vertex.label.cex=2,
                edge.color="lightgrey",
                edge.arrow.size=1)
 
-tree1graph <- graph_from_edgelist(tree1)
+tree1graph <- graph_from_edgelist(tree1)
 plot(tree1graph)

Applying the function findMRCIs gives the following:

@@ -208,7 +208,7 @@

Comparing three simple trees## [4,] 2 5 ## [5,] 3 6
-tree2graph <- graph_from_edgelist(tree2)
+tree2graph <- graph_from_edgelist(tree2)
 plot(tree2graph)

@@ -222,7 +222,7 @@ 

Comparing three simple trees## [4,] 2 6 ## [5,] 6 5

-tree3graph <- graph_from_edgelist(tree3)
+tree3graph <- graph_from_edgelist(tree3)
 plot(tree3graph)

Then we can use treespace functions to make the following @@ -387,7 +387,7 @@

Median trees## [1] 817

The first one looks like this:

-medgraph <- graph_from_edgelist(combinedLists[[med$median[[1]]]])
+medgraph <- graph_from_edgelist(combinedLists[[med$median[[1]]]])
 plot(medgraph)

diff --git a/docs/articles/TransmissionTreesVignette_files/figure-html/igraph_tree1-1.png b/docs/articles/TransmissionTreesVignette_files/figure-html/igraph_tree1-1.png index f874597..921ad0a 100644 Binary files a/docs/articles/TransmissionTreesVignette_files/figure-html/igraph_tree1-1.png and b/docs/articles/TransmissionTreesVignette_files/figure-html/igraph_tree1-1.png differ diff --git a/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-1.png b/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-1.png index fbb668d..69a690a 100644 Binary files a/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-1.png and b/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-1.png differ diff --git a/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-2.png b/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-2.png index fee3b91..4b6b9af 100644 Binary files a/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-2.png and b/docs/articles/TransmissionTreesVignette_files/figure-html/trees2_and_3-2.png differ diff --git a/docs/articles/TransmissionTreesVignette_files/figure-html/wiwMedTreePlot-1.png b/docs/articles/TransmissionTreesVignette_files/figure-html/wiwMedTreePlot-1.png index 0b14268..5cff94b 100644 Binary files a/docs/articles/TransmissionTreesVignette_files/figure-html/wiwMedTreePlot-1.png and b/docs/articles/TransmissionTreesVignette_files/figure-html/wiwMedTreePlot-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index ff00bc8..a2326ff 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/articles/introduction.html b/docs/articles/introduction.html index ce6eea2..deda219 100644 --- a/docs/articles/introduction.html +++ b/docs/articles/introduction.html @@ -33,7 +33,7 @@ treespace - 1.1.4.2 + 1.1.4.3 @@ -93,7 +93,7 @@

Exploration of landscapes of phylogenetic

Thibaut Jombart, Michelle Kendall

-

2023-04-03

+

2023-09-07

Source: vignettes/introduction.Rmd @@ -120,6 +120,14 @@

Installing treespacelibrary("treespace")
## Loading required package: ape
## Loading required package: ade4
+
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
+## which was just loaded, will retire in October 2023.
+## Please refer to R-spatial evolution reports for details, especially
+## https://r-spatial.org/r/2023/05/15/evolution4.html.
+## It may be desirable to make the sf package available;
+## package maintainers should consider adding sf to Suggests:.
+## The sp package is now running under evolution status 2
+##      (status 2 uses the sf package in place of rgdal)
## Registered S3 methods overwritten by 'adegraphics':
 ##   method         from
 ##   biplot.dudi    ade4
@@ -192,7 +200,7 @@ 

Exploring trees with treespace<

We first load treespace, and the packages required for graphics:

-
+
 library("treespace")
 library("adegenet")
 library("adegraphics")
@@ -217,7 +225,7 @@ 

Exploring trees with treespace< both the matrix of pairwise tree comparisons ($D), and the PCoA ($pco). This can be illustrated using randomly generated trees:

-
+
 # generate list of trees
 suppressWarnings(RNGversion("3.5.0"))
 set.seed(1)
@@ -228,7 +236,7 @@ 

Exploring trees with treespace< res <- treespace(x, nf=3) names(res)

## [1] "D"   "pco"
-
+
 res
## $D
 ##        tree1 tree2 tree3 tree4 tree5 tree6 tree7 tree8 tree9
@@ -264,11 +272,11 @@ 

Exploring trees with treespace< ## other elements: NULL

Pairwise tree distances can be visualised using adegraphics:

-
+
 # table.image
 table.image(res$D, nclass=30)

-
+
 # table.value with some customization
 table.value(res$D, nclass=5, method="color", 
             symbol="circle", col=redpal(5))
@@ -278,22 +286,22 @@

Exploring trees with treespace< any scatter plotting tool; here we use the treespace function plotGroves, based on the adegraphics function scatter:

-
+
 plotGroves(res$pco, lab.show=TRUE, lab.cex=1.5)

Alternatively, plotGrovesD3 creates interactive plots based on d3.js:

-
+
 plotGrovesD3(res$pco, treeNames=1:10)
-

Tree labels can be dragged into new positions to avoid problems such +

Tree labels can be dragged into new positions to avoid problems such as overlapping.

The functionality of treespace can be further illustrated using ape’s dataset woodmouse, from which we built the 201 trees supplied in woodmiceTrees using the neighbour-joining and bootstrapping example from the ape documentation.

-
+
 data(woodmiceTrees)
 wm.res <- treespace(woodmiceTrees,nf=3)
 
@@ -306,11 +314,11 @@ 

Exploring trees with treespace< ## 4 -13.6081 1.854 1.0947 ## 5 2.1980 4.176 -3.1960 ## 6 3.6013 4.865 2.9853

-
+
 # plot results
 plotGrovesD3(wm.res$pco)
-

Packages such as adegraphics and ggplot2 can be +

Packages such as adegraphics and ggplot2 can be used to make alternative plots, for example visualising the density of points within the space.

The treespace function multiDist simply @@ -341,7 +349,7 @@

Identifying clusters of trees
findGroves(wm.res, nclust=6)
 names(wm.groves)
## [1] "groups"    "treespace"
@@ -350,20 +358,20 @@

Identifying clusters of trees?plotGrovesD3 for options):

-
+
 # basic plot
 plotGrovesD3(wm.groves)
-
+
 # alternative with improved legend and tooltip text, giving the tree numbers:
 plotGrovesD3(wm.groves, tooltip_text=paste0("Tree ",1:201), legend_width=50, col_lab="Cluster")
-
+
 # plot axes 2 and 3. This helps to show why, for example, clusters 2 and 4 have been identified as separate, despite them appearing to overlap when viewing axes 1 and 2.
 plotGrovesD3(wm.groves, xax=2, yax=3, tooltip_text=paste0("Tree ",1:201), legend_width=50, col_lab="Cluster")
-

We can also plot in 3D:

-
+

We can also plot in 3D:

+
 # prepare a colour palette:
 colours <- fac2col(wm.groves$groups, col.pal=funky)
 plot3d(wm.groves$treespace$pco$li[,1],
@@ -371,8 +379,8 @@ 

Identifying clusters of treeswm.groves$treespace$pco$li[,3], col=colours, type="s", size=1.5, xlab="", ylab="", zlab="")

-
- +
+

@@ -404,7 +412,7 @@

Finding median trees
+
 # get first median tree
 tre <- medTree(woodmiceTrees)$trees[[1]]
 
@@ -414,14 +422,14 @@ 

Finding median trees
+
 # find median trees for the 6 clusters identified earlier:
 res <- medTree(woodmiceTrees, wm.groves$groups)
 
 # there is one output per cluster
 names(res)
## [1] "1" "2" "3" "4" "5" "6"
-
+
 # get the first median of each
 med.trees <- lapply(res, function(e) ladderize(e$trees[[1]]))
 
@@ -433,12 +441,12 @@ 

Finding median trees
+
 # Compare median trees from clusters 1 and 2:
 plotTreeDiff(med.trees[[1]],med.trees[[2]], use.edge.length=FALSE, 
              treesFacing = TRUE, colourMethod = "palette", palette = funky)

-
+
 # Compare median trees from clusters 1 and 4, and change aesthetics:
 plotTreeDiff(med.trees[[1]],med.trees[[4]], type="cladogram", use.edge.length=FALSE, 
              treesFacing = TRUE, edge.width=2, colourMethod="palette", palette=spectral)
@@ -469,20 +477,20 @@

Emphasising the pla and disagree on the placement of the (1007S,1208S,0909S) clade, we can simply emphasise that clade as follows:

-
+
 wm3.res <- treespace(woodmiceTrees,nf=2,emphasise.tips=c("No1007S","No1208S","No0909S"),emphasise.weight=3)
 
 # plot results
 plotGrovesD3(wm3.res$pco)
-

It can be seen from the scale of the plot and the density of +

It can be seen from the scale of the plot and the density of clustering that the trees are now separated into more distinct clusters.

-
+
 wm3.groves <- findGroves(woodmiceTrees,nf=3,nclust=6,emphasise.tips=c("No1007S","No1208S","No0909S"),emphasise.weight=3)
 plotGrovesD3(wm3.groves)
-

Conversely, where the structure of a particular clade is not of +

Conversely, where the structure of a particular clade is not of interest (for example, lineages within an outgroup which was only included for rooting purposes), those tips can be given a weight less than 1 so as to give them less emphasis in the comparison. We note that @@ -527,19 +535,19 @@

Method: characterising a tree \]

This is implemented as the function treeVec. For example,

-
+
 # generate a random tree:
 tree <- rtree(6)
 # topological vector of mrca distances from root:
 treeVec(tree)
##  [1] 2 2 0 1 3 3 0 1 2 0 1 2 0 0 1 1 1 1 1 1 1
-
+
 # vector of mrca distances from root when lambda=0.5:
 treeVec(tree,0.5)
##  [1] 1.2173 1.2173 0.0000 0.6927 2.2131 1.8866 0.0000 0.6927 1.2173 0.0000
 ## [11] 0.6927 1.2173 0.0000 0.0000 0.6927 0.5232 0.7638 0.6800 0.8382 0.6090
 ## [21] 0.5360
-
+
 # vector of mrca distances as a function of lambda:
 vecAsFunction <- treeVec(tree,return.lambda.function=TRUE)
 # evaluate the vector at lambda=0.5:
@@ -553,7 +561,7 @@ 

Method: characterising a tree d_\lambda(T_a, T_b) = || v_\lambda(T_a) - v_\lambda(T_b) ||. \]

This can be found using treeDist:

-
+
 # generate random trees
 tree_a <- rtree(6)
 tree_b <- rtree(6)
@@ -561,7 +569,7 @@ 

Method: characterising a tree # topological (lambda=0) distance: treeDist(tree_a,tree_b)

## [1] 4.123
-
+
 # branch-length focused (lambda=1) distance:
 treeDist(tree_a,tree_b,1)
## [1] 2.873
diff --git a/docs/articles/tipCategories.html b/docs/articles/tipCategories.html index 219e7f7..a2b02bf 100644 --- a/docs/articles/tipCategories.html +++ b/docs/articles/tipCategories.html @@ -33,7 +33,7 @@ treespace - 1.1.4.2 + 1.1.4.3
@@ -91,7 +91,7 @@

Comparing trees by tip label categories

Michelle Kendall

-

2023-04-03

+

2023-09-07

Source: vignettes/tipCategories.Rmd diff --git a/docs/authors.html b/docs/authors.html index 40c4a78..1ae935b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/index.html b/docs/index.html index b4b5de3..ec6893a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -36,7 +36,7 @@ treespace - 1.1.4.2 + 1.1.4.3

@@ -101,34 +101,34 @@

Installing treespace

To install the development version from github:

-
library(devtools)
-install_github("thibautjombart/treespace")
+
library(devtools)
+install_github("thibautjombart/treespace")

The stable version can be installed from CRAN using:

-
install.packages("treespace")
+
install.packages("treespace")

Then, to load the package, use:

-
library("treespace")
-
-## Loading required package: ape
-
-## Loading required package: ade4
-
-## Registered S3 methods overwritten by 'adegraphics':
-##   method         from
-##   biplot.dudi    ade4
-##   kplot.foucart  ade4
-##   kplot.mcoa     ade4
-##   kplot.mfa      ade4
-##   kplot.pta      ade4
-##   kplot.sepan    ade4
-##   kplot.statis   ade4
-##   scatter.coa    ade4
-##   scatter.dudi   ade4
-##   scatter.nipals ade4
-##   scatter.pco    ade4
-##   score.acm      ade4
-##   score.mix      ade4
-##   score.pca      ade4
-##   screeplot.dudi ade4
+
library("treespace")
+
+## Loading required package: ape
+
+## Loading required package: ade4
+
+## Registered S3 methods overwritten by 'adegraphics':
+##   method         from
+##   biplot.dudi    ade4
+##   kplot.foucart  ade4
+##   kplot.mcoa     ade4
+##   kplot.mfa      ade4
+##   kplot.pta      ade4
+##   kplot.sepan    ade4
+##   kplot.statis   ade4
+##   scatter.coa    ade4
+##   scatter.dudi   ade4
+##   scatter.nipals ade4
+##   scatter.pco    ade4
+##   score.acm      ade4
+##   score.mix      ade4
+##   score.pca      ade4
+##   screeplot.dudi ade4

Content overview diff --git a/docs/news/index.html b/docs/news/index.html index 7349d0e..121a49f 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3

@@ -67,7 +67,11 @@

Changelog

- + +

Patch to remove dependency on the adephylo package as required by CRAN - hopefully only temporarily.

+
+
+

Fixing a bug which was affecting the compilation of vignettes: the treespace function can now handle NA row (tree) names. Also added explicit argument calls in unit test functions, updated the citation file to use bibentry rather than the old-style citEntry as suggested by CRAN, and updated links to authors’ websites.

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 5caf61a..e9f622e 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 2.19.2 +pandoc: 3.1.1 pkgdown: 2.0.7 pkgdown_sha: ~ articles: @@ -6,5 +6,5 @@ articles: TransmissionTreesVignette: TransmissionTreesVignette.html introduction: introduction.html tipCategories: tipCategories.html -last_built: 2023-04-03T07:38Z +last_built: 2023-09-07T15:32Z diff --git a/docs/reference/DengueBEASTMCC.html b/docs/reference/DengueBEASTMCC.html index 5e4b39b..6b4ab81 100644 --- a/docs/reference/DengueBEASTMCC.html +++ b/docs/reference/DengueBEASTMCC.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/DengueSeqs.html b/docs/reference/DengueSeqs.html index 4334558..e441975 100644 --- a/docs/reference/DengueSeqs.html +++ b/docs/reference/DengueSeqs.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/DengueTrees.html b/docs/reference/DengueTrees.html index 3b77710..720bc50 100644 --- a/docs/reference/DengueTrees.html +++ b/docs/reference/DengueTrees.html @@ -19,7 +19,7 @@ treespace - 1.1.4.2 + 1.1.4.3

diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png index a53733d..49a1df6 100644 Binary files a/docs/reference/Rplot004.png and b/docs/reference/Rplot004.png differ diff --git a/docs/reference/dot-render.server.info.html b/docs/reference/dot-render.server.info.html index 24bdafb..1ab77db 100644 --- a/docs/reference/dot-render.server.info.html +++ b/docs/reference/dot-render.server.info.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/findGroves.html b/docs/reference/findGroves.html index d81d617..15ddc2e 100644 --- a/docs/reference/findGroves.html +++ b/docs/reference/findGroves.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3

diff --git a/docs/reference/findMRCIs.html b/docs/reference/findMRCIs.html index 0ad229e..4351a66 100644 --- a/docs/reference/findMRCIs.html +++ b/docs/reference/findMRCIs.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3

diff --git a/docs/reference/fluTrees.html b/docs/reference/fluTrees.html index 5a8de31..1834ef8 100644 --- a/docs/reference/fluTrees.html +++ b/docs/reference/fluTrees.html @@ -19,7 +19,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/index.html b/docs/reference/index.html index 5a1bbe9..036c1f3 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3

diff --git a/docs/reference/linearMrca.html b/docs/reference/linearMrca.html index 448f204..a7fde25 100644 --- a/docs/reference/linearMrca.html +++ b/docs/reference/linearMrca.html @@ -18,7 +18,7 @@ treespace - 1.1.4.2 + 1.1.4.3

@@ -101,12 +101,12 @@

Examples

## create matrix of MRCAs: entry (i,j) is the node number of the MRCA of tips i and j linearMrca(x,6) #> [,1] [,2] [,3] [,4] [,5] [,6] -#> [1,] 1 7 7 7 7 7 -#> [2,] 7 2 8 8 8 8 -#> [3,] 7 8 3 9 9 9 -#> [4,] 7 8 9 4 10 10 -#> [5,] 7 8 9 10 5 11 -#> [6,] 7 8 9 10 11 6 +#> [1,] 1 8 7 7 7 7 +#> [2,] 8 2 7 7 7 7 +#> [3,] 7 7 3 9 9 9 +#> [4,] 7 7 9 4 11 10 +#> [5,] 7 7 9 11 5 10 +#> [6,] 7 7 9 10 10 6
diff --git a/docs/reference/makeCollapsedTree-1.png b/docs/reference/makeCollapsedTree-1.png index 4e950fe..26c444f 100644 Binary files a/docs/reference/makeCollapsedTree-1.png and b/docs/reference/makeCollapsedTree-1.png differ diff --git a/docs/reference/makeCollapsedTree-2.png b/docs/reference/makeCollapsedTree-2.png index 10fd653..890176c 100644 Binary files a/docs/reference/makeCollapsedTree-2.png and b/docs/reference/makeCollapsedTree-2.png differ diff --git a/docs/reference/makeCollapsedTree-3.png b/docs/reference/makeCollapsedTree-3.png index 6631bec..f88602b 100644 Binary files a/docs/reference/makeCollapsedTree-3.png and b/docs/reference/makeCollapsedTree-3.png differ diff --git a/docs/reference/makeCollapsedTree-4.png b/docs/reference/makeCollapsedTree-4.png index 3dfd522..726f1ef 100644 Binary files a/docs/reference/makeCollapsedTree-4.png and b/docs/reference/makeCollapsedTree-4.png differ diff --git a/docs/reference/makeCollapsedTree.html b/docs/reference/makeCollapsedTree.html index dfc822d..cf5d08f 100644 --- a/docs/reference/makeCollapsedTree.html +++ b/docs/reference/makeCollapsedTree.html @@ -19,7 +19,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/medTree.html b/docs/reference/medTree.html index 7e3302d..730636d 100644 --- a/docs/reference/medTree.html +++ b/docs/reference/medTree.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/multiDist.html b/docs/reference/multiDist.html index 78f592b..445e48e 100644 --- a/docs/reference/multiDist.html +++ b/docs/reference/multiDist.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3

@@ -130,15 +130,15 @@

Examples

## pairwise distance matrix when lambda=0 multiDist(trees) #> 1 2 3 4 5 6 7 8 -#> 2 4.000000 -#> 3 4.242641 4.000000 -#> 4 4.472136 4.690416 5.656854 -#> 5 4.582576 3.605551 5.000000 5.000000 -#> 6 3.872983 5.385165 5.196152 6.557439 5.656854 -#> 7 4.358899 4.358899 5.000000 4.358899 4.242641 5.830952 -#> 8 4.690416 4.898979 5.291503 5.656854 4.358899 6.244998 5.000000 -#> 9 4.472136 4.000000 4.898979 4.690416 4.358899 6.082763 3.605551 4.690416 -#> 10 5.916080 5.916080 7.000000 6.244998 6.782330 5.477226 5.830952 7.141428 +#> 2 5.567764 +#> 3 3.605551 4.242641 +#> 4 6.557439 5.099020 5.477226 +#> 5 5.916080 4.690416 5.477226 5.477226 +#> 6 6.082763 4.898979 5.477226 3.162278 5.477226 +#> 7 6.708204 4.690416 5.477226 4.690416 5.656854 4.898979 +#> 8 6.928203 5.567764 6.244998 7.141428 6.244998 7.000000 4.582576 +#> 9 5.000000 5.291503 4.898979 5.656854 4.472136 5.656854 5.656854 7.141428 +#> 10 2.645751 5.099020 4.242641 5.830952 5.099020 5.291503 5.830952 6.403124 #> 9 #> 2 #> 3 @@ -148,7 +148,7 @@

Examples

#> 7 #> 8 #> 9 -#> 10 5.916080 +#> 10 5.291503 ## pairwise distance matrix as a function of lambda: m <- multiDist(trees, return.lambda.function=TRUE) diff --git a/docs/reference/plotGroves.html b/docs/reference/plotGroves.html index 35381ef..267d817 100644 --- a/docs/reference/plotGroves.html +++ b/docs/reference/plotGroves.html @@ -19,7 +19,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/plotGrovesD3.html b/docs/reference/plotGrovesD3.html index 624ee7d..c36cc70 100644 --- a/docs/reference/plotGrovesD3.html +++ b/docs/reference/plotGrovesD3.html @@ -20,7 +20,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/plotTreeDiff.html b/docs/reference/plotTreeDiff.html index 8bb6483..c4d203a 100644 --- a/docs/reference/plotTreeDiff.html +++ b/docs/reference/plotTreeDiff.html @@ -19,7 +19,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/refTreeDist.html b/docs/reference/refTreeDist.html index cba343b..dfb10a9 100644 --- a/docs/reference/refTreeDist.html +++ b/docs/reference/refTreeDist.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
@@ -131,8 +131,8 @@

Examples

## find the distances from each of the 10 random trees to the single reference tree refTreeDist(refTree,trees) -#> [1] 5.196152 3.605551 4.358899 6.633250 5.477226 3.316625 4.123106 5.000000 -#> [9] 4.582576 3.741657 +#> [1] 6.403124 4.358899 3.872983 6.082763 6.855655 6.557439 6.244998 5.744563 +#> [9] 6.324555 6.082763

diff --git a/docs/reference/relatedTreeDist-1.png b/docs/reference/relatedTreeDist-1.png index 178284e..80d7470 100644 Binary files a/docs/reference/relatedTreeDist-1.png and b/docs/reference/relatedTreeDist-1.png differ diff --git a/docs/reference/relatedTreeDist.html b/docs/reference/relatedTreeDist.html index e5c90d7..2e030fc 100644 --- a/docs/reference/relatedTreeDist.html +++ b/docs/reference/relatedTreeDist.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
@@ -120,9 +120,9 @@

Examples

relatedTreeDist(trees,df) #> 1 2 3 4 #> 2 0.000000 -#> 3 1.736555 1.736555 -#> 4 2.281036 2.281036 1.274755 -#> 5 3.641128 3.641128 2.292992 2.351861 +#> 3 1.119780 1.119780 +#> 4 1.756684 1.756684 1.737680 +#> 5 2.501562 2.501562 1.991192 1.530931 # Note that trees 1 and 2 have different numbers of tips but the relationships between those tips # are identical at the category level, hence the related tree distance is 0. diff --git a/docs/reference/simulateIndTree-1.png b/docs/reference/simulateIndTree-1.png index 9f42c82..a66e05c 100644 Binary files a/docs/reference/simulateIndTree-1.png and b/docs/reference/simulateIndTree-1.png differ diff --git a/docs/reference/simulateIndTree.html b/docs/reference/simulateIndTree.html index 3aa6708..22eee29 100644 --- a/docs/reference/simulateIndTree.html +++ b/docs/reference/simulateIndTree.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3
diff --git a/docs/reference/tipDiff.html b/docs/reference/tipDiff.html index 4fff339..a7b59e7 100644 --- a/docs/reference/tipDiff.html +++ b/docs/reference/tipDiff.html @@ -18,7 +18,7 @@ treespace - 1.1.4.2 + 1.1.4.3

diff --git a/docs/reference/tipsMRCAdepths-1.png b/docs/reference/tipsMRCAdepths-1.png index 2f29cee..4b38b02 100644 Binary files a/docs/reference/tipsMRCAdepths-1.png and b/docs/reference/tipsMRCAdepths-1.png differ diff --git a/docs/reference/tipsMRCAdepths.html b/docs/reference/tipsMRCAdepths.html index 93dd151..af21bfc 100644 --- a/docs/reference/tipsMRCAdepths.html +++ b/docs/reference/tipsMRCAdepths.html @@ -18,7 +18,7 @@ treespace - 1.1.4.2 + 1.1.4.3
@@ -92,50 +92,50 @@

Examples

tipsMRCAdepths(tree) #> tip1 tip2 rootdist #> [1,] "t1" "t10" "0" -#> [2,] "t1" "t2" "0" -#> [3,] "t1" "t3" "1" -#> [4,] "t1" "t4" "0" -#> [5,] "t1" "t5" "1" +#> [2,] "t1" "t2" "1" +#> [3,] "t1" "t3" "4" +#> [4,] "t1" "t4" "3" +#> [5,] "t1" "t5" "3" #> [6,] "t1" "t6" "2" -#> [7,] "t1" "t7" "0" -#> [8,] "t1" "t8" "0" -#> [9,] "t1" "t9" "2" -#> [10,] "t10" "t2" "1" +#> [7,] "t1" "t7" "2" +#> [8,] "t1" "t8" "3" +#> [9,] "t1" "t9" "1" +#> [10,] "t10" "t2" "0" #> [11,] "t10" "t3" "0" -#> [12,] "t10" "t4" "2" +#> [12,] "t10" "t4" "0" #> [13,] "t10" "t5" "0" #> [14,] "t10" "t6" "0" -#> [15,] "t10" "t7" "1" -#> [16,] "t10" "t8" "1" +#> [15,] "t10" "t7" "0" +#> [16,] "t10" "t8" "0" #> [17,] "t10" "t9" "0" -#> [18,] "t2" "t3" "0" +#> [18,] "t2" "t3" "1" #> [19,] "t2" "t4" "1" -#> [20,] "t2" "t5" "0" -#> [21,] "t2" "t6" "0" -#> [22,] "t2" "t7" "2" -#> [23,] "t2" "t8" "3" -#> [24,] "t2" "t9" "0" -#> [25,] "t3" "t4" "0" -#> [26,] "t3" "t5" "2" -#> [27,] "t3" "t6" "1" -#> [28,] "t3" "t7" "0" -#> [29,] "t3" "t8" "0" +#> [20,] "t2" "t5" "1" +#> [21,] "t2" "t6" "1" +#> [22,] "t2" "t7" "1" +#> [23,] "t2" "t8" "1" +#> [24,] "t2" "t9" "2" +#> [25,] "t3" "t4" "3" +#> [26,] "t3" "t5" "3" +#> [27,] "t3" "t6" "2" +#> [28,] "t3" "t7" "2" +#> [29,] "t3" "t8" "3" #> [30,] "t3" "t9" "1" -#> [31,] "t4" "t5" "0" -#> [32,] "t4" "t6" "0" -#> [33,] "t4" "t7" "1" -#> [34,] "t4" "t8" "1" -#> [35,] "t4" "t9" "0" -#> [36,] "t5" "t6" "1" -#> [37,] "t5" "t7" "0" -#> [38,] "t5" "t8" "0" +#> [31,] "t4" "t5" "5" +#> [32,] "t4" "t6" "2" +#> [33,] "t4" "t7" "2" +#> [34,] "t4" "t8" "4" +#> [35,] "t4" "t9" "1" +#> [36,] "t5" "t6" "2" +#> [37,] "t5" "t7" "2" +#> [38,] "t5" "t8" "4" #> [39,] "t5" "t9" "1" -#> [40,] "t6" "t7" "0" -#> [41,] "t6" "t8" "0" -#> [42,] "t6" "t9" "3" +#> [40,] "t6" "t7" "3" +#> [41,] "t6" "t8" "2" +#> [42,] "t6" "t9" "1" #> [43,] "t7" "t8" "2" -#> [44,] "t7" "t9" "0" -#> [45,] "t8" "t9" "0" +#> [44,] "t7" "t9" "1" +#> [45,] "t8" "t9" "1"
diff --git a/docs/reference/treeConcordance-4.png b/docs/reference/treeConcordance-4.png index b693738..9c532f2 100644 Binary files a/docs/reference/treeConcordance-4.png and b/docs/reference/treeConcordance-4.png differ diff --git a/docs/reference/treeConcordance.html b/docs/reference/treeConcordance.html index 3c302d3..ab0bf55 100644 --- a/docs/reference/treeConcordance.html +++ b/docs/reference/treeConcordance.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 @@ -126,7 +126,7 @@

Examples

plot(indTree3) treeConcordance(catTree,indTree3,df) -#> [1] 0.8435556 +#> [1] 0.6071111 diff --git a/docs/reference/treeDist-1.png b/docs/reference/treeDist-1.png index 16c802f..11e6d4c 100644 Binary files a/docs/reference/treeDist-1.png and b/docs/reference/treeDist-1.png differ diff --git a/docs/reference/treeDist-2.png b/docs/reference/treeDist-2.png index 91f08a1..6456419 100644 Binary files a/docs/reference/treeDist-2.png and b/docs/reference/treeDist-2.png differ diff --git a/docs/reference/treeDist.html b/docs/reference/treeDist.html index b67a4e1..92b70d4 100644 --- a/docs/reference/treeDist.html +++ b/docs/reference/treeDist.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 @@ -128,12 +128,12 @@

Examples

tree.a <- rtree(6) tree.b <- rtree(6) treeDist(tree.a,tree.b) # lambda=0 -#> [1] 6.708204 +#> [1] 5.91608 treeDist(tree.a,tree.b,1) # lambda=1 -#> [1] 4.038865 +#> [1] 3.524648 dist.func <- treeDist(tree.a,tree.b,return.lambda.function=TRUE) # distance as a function of lambda dist.func(0) # evaluate at lambda=0. Equivalent to treeDist(tree.a,tree.b). -#> [1] 6.708204 +#> [1] 5.91608 ## We can see how the distance changes when moving from focusing on topology to length: plot(sapply(seq(0,1,length.out=100), function(x) dist.func(x)), type="l",ylab="",xlab="") diff --git a/docs/reference/treeVec.html b/docs/reference/treeVec.html index 193202e..26811ce 100644 --- a/docs/reference/treeVec.html +++ b/docs/reference/treeVec.html @@ -19,7 +19,7 @@ treespace - 1.1.4.2 + 1.1.4.3 @@ -126,19 +126,19 @@

Examples

tree <- rtree(6) ## topological vector of mrca distances from root: treeVec(tree) -#> [1] 0 1 0 0 0 0 1 1 1 0 0 0 2 2 3 1 1 1 1 1 1 +#> [1] 2 0 1 4 3 0 1 2 2 0 0 0 1 1 3 1 1 1 1 1 1 ## vector of mrca distances from root when lambda=0.5: treeVec(tree,0.5) -#> [1] 0.0000000 0.6321170 0.0000000 0.0000000 0.0000000 0.0000000 0.5402072 -#> [8] 0.5402072 0.5402072 0.0000000 0.0000000 0.0000000 1.4070278 1.4070278 -#> [15] 2.0540922 0.9974447 0.6251924 0.6759009 0.7006669 0.7546641 0.6467896 +#> [1] 1.6950163 0.0000000 0.8111938 3.2935701 2.4977981 0.0000000 0.8111938 +#> [8] 1.6950163 1.6950163 0.0000000 0.0000000 0.0000000 0.8111938 0.8111938 +#> [15] 2.4977981 0.9185741 0.7899246 0.6847264 0.5418258 0.9862842 0.5838880 ## vector of mrca distances as a function of lambda: vecAsFunction <- treeVec(tree,return.lambda.function=TRUE) ## evaluate the vector at lambda=0.5: vecAsFunction(0.5) -#> [1] 0.0000000 0.6321170 0.0000000 0.0000000 0.0000000 0.0000000 0.5402072 -#> [8] 0.5402072 0.5402072 0.0000000 0.0000000 0.0000000 1.4070278 1.4070278 -#> [15] 2.0540922 0.9974447 0.6251924 0.6759009 0.7006669 0.7546641 0.6467896 +#> [1] 1.6950163 0.0000000 0.8111938 3.2935701 2.4977981 0.0000000 0.8111938 +#> [8] 1.6950163 1.6950163 0.0000000 0.0000000 0.0000000 0.8111938 0.8111938 +#> [15] 2.4977981 0.9185741 0.7899246 0.6847264 0.5418258 0.9862842 0.5838880
diff --git a/docs/reference/treespace-1.png b/docs/reference/treespace-1.png index b0696db..d82a660 100644 Binary files a/docs/reference/treespace-1.png and b/docs/reference/treespace-1.png differ diff --git a/docs/reference/treespace.html b/docs/reference/treespace.html index 6bd439f..f96bb66 100644 --- a/docs/reference/treespace.html +++ b/docs/reference/treespace.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/reference/treespaceServer.html b/docs/reference/treespaceServer.html index fecb833..8630af5 100644 --- a/docs/reference/treespaceServer.html +++ b/docs/reference/treespaceServer.html @@ -18,7 +18,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/reference/wiwMedTree.html b/docs/reference/wiwMedTree.html index cc6a173..89c007c 100644 --- a/docs/reference/wiwMedTree.html +++ b/docs/reference/wiwMedTree.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/reference/wiwTreeDist.html b/docs/reference/wiwTreeDist.html index 3585b66..83018a4 100644 --- a/docs/reference/wiwTreeDist.html +++ b/docs/reference/wiwTreeDist.html @@ -17,7 +17,7 @@ treespace - 1.1.4.2 + 1.1.4.3 diff --git a/docs/reference/woodmiceTrees.html b/docs/reference/woodmiceTrees.html index f66dbd1..e179b9d 100644 --- a/docs/reference/woodmiceTrees.html +++ b/docs/reference/woodmiceTrees.html @@ -18,7 +18,7 @@ treespace - 1.1.4.2 + 1.1.4.3