From de4a5d693bdb8c01f549627130af9d6b7a36462c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 9 Jan 2019 15:01:57 +0000 Subject: [PATCH] Link class `phylo` --- R/PartitionDistance.R | 2 +- R/QuartetDistance.R | 8 ++++-- R/TreeManipulation.R | 7 +++-- R/tqDist.r | 5 ++-- man/PairSharedQuartetStatus.Rd | 3 +- man/PairSharedSplitStatus.Rd | 2 +- man/PlotQuartet.Rd | 3 +- man/QuartetState.Rd | 2 +- man/SimilarityMetrics.Rd | 2 +- man/TQDist.Rd | 5 ++-- man/UnshiftTree.Rd | 7 +++-- vignettes/Tree-distance-metrics.aux | 44 ----------------------------- 12 files changed, 27 insertions(+), 63 deletions(-) delete mode 100644 vignettes/Tree-distance-metrics.aux diff --git a/R/PartitionDistance.R b/R/PartitionDistance.R index 57678209..96ab8844 100644 --- a/R/PartitionDistance.R +++ b/R/PartitionDistance.R @@ -205,7 +205,7 @@ SharedBipartitionStatus <- SharedSplitStatus #' Removes all tips that do not occur in both `ref` and `cf`, then calculates #' the status of the remaining splits #' -#' @param ref,cf Trees of class phylo to compare. +#' @param ref,cf Trees of class \code{\link[ape:read.tree]{phylo}} to compare. #' #' @return Named integer of length 6, as per [CompareSplits] #' diff --git a/R/QuartetDistance.R b/R/QuartetDistance.R index a8b29ace..c0368904 100644 --- a/R/QuartetDistance.R +++ b/R/QuartetDistance.R @@ -5,7 +5,8 @@ WHICH_OTHER_NODE <- 2:4 #' Draws a tree, highlighting the members of a specified quartet in colour. #' #' -#' @param tree A tree of class \code{phylo}, or a list of such trees. +#' @param tree A tree of class \code{\link[ape:read.tree]{phylo}}, +#' or a list of such trees. #' @param quartet A vector of four integers, corresponding to numbered tips on #' the tree; or a character vector specifying the labels of four #' tips. @@ -154,7 +155,7 @@ QuartetState <- function (tips, bips) { #' @param splits A list of bipartition splits, perhaps generated using #' \code{\link[TreeSearch]{Tree2Splits}}, with row names corresponding #' to taxon labels. -#' If a tree or list of trees (of class `phylo`) is sent instead, +#' If a tree or list of trees (of class \code{\link[ape:read.tree]{phylo}}) is sent instead, #' it will be silently converted to its constituent splits. #' #' @importFrom TreeSearch Tree2Splits @@ -238,7 +239,8 @@ SharedQuartetStatus <- function (trees, cf=trees[[1]]) { #' Removes all tips that do not occur in both `tree1` and `tree2`, then calculates #' the status of the remaining quartets. #' -#' @param tree1,tree2 Trees of class phylo to compare. +#' @param tree1,tree2 Trees of class \code{\link[ape:read.tree]{phylo}} +#' to compare. #' #' @templateVar intro Returns a named array of six integers corresponding to the quantities of Estabrook _et al_. (1985): #' @template returnEstabrook diff --git a/R/TreeManipulation.R b/R/TreeManipulation.R index 90f532a7..b4f3f364 100644 --- a/R/TreeManipulation.R +++ b/R/TreeManipulation.R @@ -6,9 +6,10 @@ #' Adding a tree to a multiPhylo object whose own attributes apply to all trees, #' for example trees read from a nexus file, causes data to be lost. #' -#' @param add Tree to add to the list, of class \code{phylo} -#' @param treeList A list of trees, of class \code{list}, \code{multiPhylo}, -#' or, if a single tree, \code{phylo}. +#' @param add Tree to add to the list, of class \code{\link[ape:read.tree]{phylo}}. +#' @param treeList A list of trees, of class \code{list}, +#' \code{\link[ape:multiphylo]{multiPhylo}}, +#' or, if a single tree, \code{\link[ape:read.tree]{phylo}}. #' #' @return A list of class \code{list} or \code{multiPhylo} (following the #' original class of \code{treeList}), whose first element is the tree specified diff --git a/R/tqDist.r b/R/tqDist.r index e206b59f..c82957ba 100644 --- a/R/tqDist.r +++ b/R/tqDist.r @@ -17,7 +17,8 @@ #' #' #' @param treeList List of phylogenetic trees, of class \code{list} or -#' \code{phylo}. All trees must be bifurcating. +#' \code{\link[ape:read.tree]{phylo}}. +#' All trees must be bifurcating. #' @return `TQDist` returns the quartet distance between each pair of trees. #' #' @references @@ -74,7 +75,7 @@ ManyToManyQuartetAgreement <- function (treeList) { #' @describeIn TQDist Agreement of each quartet in trees in a list with the #' quartets in a comparison tree. -#' @param comparison A tree of class `phylo` against which to compare the trees +#' @param comparison A tree of class \code{\link[ape:read.tree]{phylo}} against which to compare the trees #' in `treeList`. #' @return `SingleTreeQuartetAgreement` returns a two-dimensional array listing, #' for tree in `treeList`, the total number of quartets and the diff --git a/man/PairSharedQuartetStatus.Rd b/man/PairSharedQuartetStatus.Rd index 06953687..9af009d3 100644 --- a/man/PairSharedQuartetStatus.Rd +++ b/man/PairSharedQuartetStatus.Rd @@ -7,7 +7,8 @@ PairSharedQuartetStatus(tree1, tree2) } \arguments{ -\item{tree1, tree2}{Trees of class phylo to compare.} +\item{tree1, tree2}{Trees of class \code{\link[ape:read.tree]{phylo}} +to compare.} } \value{ Returns a named array of six integers corresponding to the quantities of Estabrook \emph{et al}. (1985): diff --git a/man/PairSharedSplitStatus.Rd b/man/PairSharedSplitStatus.Rd index 643039df..a1f81f31 100644 --- a/man/PairSharedSplitStatus.Rd +++ b/man/PairSharedSplitStatus.Rd @@ -7,7 +7,7 @@ PairSharedSplitStatus(ref, cf) } \arguments{ -\item{ref, cf}{Trees of class phylo to compare.} +\item{ref, cf}{Trees of class \code{\link[ape:read.tree]{phylo}} to compare.} } \value{ Named integer of length 6, as per \link{CompareSplits} diff --git a/man/PlotQuartet.Rd b/man/PlotQuartet.Rd index 35e64980..e5c8ddd6 100644 --- a/man/PlotQuartet.Rd +++ b/man/PlotQuartet.Rd @@ -7,7 +7,8 @@ PlotQuartet(tree, quartet, overwritePar = TRUE, caption = TRUE, ...) } \arguments{ -\item{tree}{A tree of class \code{phylo}, or a list of such trees.} +\item{tree}{A tree of class \code{\link[ape:read.tree]{phylo}}, +or a list of such trees.} \item{quartet}{A vector of four integers, corresponding to numbered tips on the tree; or a character vector specifying the labels of four diff --git a/man/QuartetState.Rd b/man/QuartetState.Rd index ff768cc9..3aeebf72 100644 --- a/man/QuartetState.Rd +++ b/man/QuartetState.Rd @@ -18,7 +18,7 @@ number (if class \code{numeric}) or their name (if class \code{character}).} \item{splits}{A list of bipartition splits, perhaps generated using \code{\link[TreeSearch]{Tree2Splits}}, with row names corresponding to taxon labels. -If a tree or list of trees (of class \code{phylo}) is sent instead, +If a tree or list of trees (of class \code{\link[ape:read.tree]{phylo}}) is sent instead, it will be silently converted to its constituent splits.} } \value{ diff --git a/man/SimilarityMetrics.Rd b/man/SimilarityMetrics.Rd index 596e4796..69081153 100644 --- a/man/SimilarityMetrics.Rd +++ b/man/SimilarityMetrics.Rd @@ -80,7 +80,7 @@ which this package calculates using the function \code{SteelPenny}: \item Steel & Penny's Quartet Metric (dQ): (\emph{s} + \emph{u}) / \emph{Q} } -Although defined using quartets, analagous values can be calculated using +Although defined using quartets, analogous values can be calculated using partitions by replacing \emph{s} and \emph{d} with 2_s_ and (\emph{d1} + \emph{d2}), and \emph{Q} with \emph{N}. Note that, for reasons listed elsewhere (see Smith 2019, supplementary text), diff --git a/man/TQDist.Rd b/man/TQDist.Rd index faa7006b..5d1d0524 100644 --- a/man/TQDist.Rd +++ b/man/TQDist.Rd @@ -17,9 +17,10 @@ SingleTreeQuartetAgreement(treeList, comparison) } \arguments{ \item{treeList}{List of phylogenetic trees, of class \code{list} or -\code{phylo}. All trees must be bifurcating.} +\code{\link[ape:read.tree]{phylo}}. +All trees must be bifurcating.} -\item{comparison}{A tree of class \code{phylo} against which to compare the trees +\item{comparison}{A tree of class \code{\link[ape:read.tree]{phylo}} against which to compare the trees in \code{treeList}.} } \value{ diff --git a/man/UnshiftTree.Rd b/man/UnshiftTree.Rd index a0c7d36a..2191d2ce 100644 --- a/man/UnshiftTree.Rd +++ b/man/UnshiftTree.Rd @@ -7,10 +7,11 @@ UnshiftTree(add, treeList) } \arguments{ -\item{add}{Tree to add to the list, of class \code{phylo}} +\item{add}{Tree to add to the list, of class \code{\link[ape:read.tree]{phylo}}.} -\item{treeList}{A list of trees, of class \code{list}, \code{multiPhylo}, -or, if a single tree, \code{phylo}.} +\item{treeList}{A list of trees, of class \code{list}, +\code{\link[ape:multiphylo]{multiPhylo}}, +or, if a single tree, \code{\link[ape:read.tree]{phylo}}.} } \value{ A list of class \code{list} or \code{multiPhylo} (following the diff --git a/vignettes/Tree-distance-metrics.aux b/vignettes/Tree-distance-metrics.aux deleted file mode 100644 index f66d8be0..00000000 --- a/vignettes/Tree-distance-metrics.aux +++ /dev/null @@ -1,44 +0,0 @@ -\relax -\providecommand\hyper@newdestlabel[2]{} -\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} -\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined -\global\let\oldcontentsline\contentsline -\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} -\global\let\oldnewlabel\newlabel -\gdef\newlabel#1#2{\newlabelxx{#1}#2} -\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} -\AtEndDocument{\ifx\hyper@anchor\@undefined -\let\contentsline\oldcontentsline -\let\newlabel\oldnewlabel -\fi} -\fi} -\global\let\hyper@last\relax -\gdef\HyperFirstAtBeginDocument#1{#1} -\providecommand\HyField@AuxAddToFields[1]{} -\providecommand\HyField@AuxAddToCoFields[2]{} -\@writefile{toc}{\contentsline {section}{\numberline {1}Tree distance metrics}{1}{section.1}} -\newlabel{tree-distance-metrics}{{1}{1}{Tree distance metrics}{section.1}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}SPR metric}{1}{subsection.1.1}} -\newlabel{spr-metric}{{1.1}{1}{SPR metric}{subsection.1.1}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Path difference metric}{1}{subsection.1.2}} -\newlabel{path-difference-metric}{{1.2}{1}{Path difference metric}{subsection.1.2}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Partition metric}{1}{subsection.1.3}} -\newlabel{partition-metric}{{1.3}{1}{Partition metric}{subsection.1.3}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.4}Quartet metric}{2}{subsection.1.4}} -\newlabel{quartet-metric}{{1.4}{2}{Quartet metric}{subsection.1.4}{}} -\@writefile{toc}{\contentsline {section}{\numberline {2}Desired behaviour of tree distance metrics}{2}{section.2}} -\newlabel{desired-behaviour-of-tree-distance-metrics}{{2}{2}{Desired behaviour of tree distance metrics}{section.2}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Moving a single taxon}{3}{subsection.2.1}} -\newlabel{moving-a-single-taxon}{{2.1}{3}{Moving a single taxon}{subsection.2.1}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Moving two taxa}{3}{subsection.2.2}} -\newlabel{moving-two-taxa}{{2.2}{3}{Moving two taxa}{subsection.2.2}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Maximum distance}{4}{subsection.2.3}} -\newlabel{maximum-distance}{{2.3}{4}{Maximum distance}{subsection.2.3}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Unit equivalence}{6}{subsection.2.4}} -\newlabel{unit-equivalence}{{2.4}{6}{Unit equivalence}{subsection.2.4}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Unresolved trees}{7}{subsection.2.5}} -\newlabel{unresolved-trees}{{2.5}{7}{Unresolved trees}{subsection.2.5}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.6}Conclusion}{7}{subsection.2.6}} -\newlabel{conclusion}{{2.6}{7}{Conclusion}{subsection.2.6}{}} -\newlabel{references}{{2.6}{8}{References}{section*.2}{}} -\@writefile{toc}{\contentsline {section}{References}{8}{section*.2}}