Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ jobs:
run: |
brew install xquartz ghostscript

- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
if: runner.os != 'Linux'
run: |
Expand All @@ -102,12 +109,16 @@ jobs:
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
waldo@0.5.3
testthat@3.2.1
vdiffr@1.0.7
cpp11@0.5.0
httr2@1.0.1
downlit@0.4.3
pkgdown@2.0.9
profvis@0.3.8
gtable@0.3.5
evaluate@0.23
httr2@1.0.1
knitr@1.45
phangorn@2.7.1
rjson@0.2.20
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Quartet
Version: 1.2.7
Version: 1.3.0
Title: Comparison of Phylogenetic Trees Using Quartet and Split Measures
Description: Calculates the number of four-taxon subtrees consistent with a pair
of cladograms, calculating the symmetric quartet distance of Bandelt & Dress
Expand Down Expand Up @@ -46,6 +46,7 @@ Suggests:
Rcpp,
rmarkdown,
testthat,
TreeDist,
usethis,
vdiffr,
Config/Needs/check:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export(PairSharedQuartetStatus)
export(PairSharedSplitStatus)
export(PairsQuartetDistance)
export(PairsTripletDistance)
export(PairwiseQuartets)
export(PlotQuartet)
export(QuartetAgreement)
export(QuartetDistance)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Quartet v1.3.0 (2025-01-16)

- `PairwiseQuartets()` compares quartet statuses between all pairs of trees.

# Quartet v1.2.7 (2024-10-31)

- `VizualizeQuartet()` now returns calculation results.
Expand Down
1 change: 1 addition & 0 deletions Quartet.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 69de0ca2-bd58-49e4-8173-98d3d2d703f4

RestoreWorkspace: Yes
SaveWorkspace: No
Expand Down
6 changes: 3 additions & 3 deletions R/CompareQuartets.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @template MRS
#'
#' @family quartet counting functions
#' @family enumeration
#' @seealso
#' States of quartets in given trees: [`QuartetStates()`]
#'
Expand Down Expand Up @@ -176,7 +176,7 @@ QuartetStates.multiPhylo <- QuartetStates.list
#' @template MRS
#'
#' @family element-by-element comparisons
#' @family quartet counting functions
#' @family enumeration
#'
#' @seealso
#' - [`QuartetStatus()`] generates the same output from a list of trees.
Expand Down Expand Up @@ -256,7 +256,7 @@ CompareQuartets <- function (x, cf) {
#'
#' @template MRS
#' @family element-by-element comparisons
#' @family quartet counting functions
#' @family enumeration
#'
#' @examples
#' library("TreeTools")
Expand Down
1 change: 1 addition & 0 deletions R/Metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#' \insertAllCited{}
#'
#' @template MRS
#' @family tree comparison
#'
#' @encoding UTF-8
#' @name SimilarityMetrics
Expand Down
40 changes: 40 additions & 0 deletions R/PairwiseQuartets.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#' Pairwise quartet distances
#'
#' Computes the quartet distance between each pair of trees in a list.
#'
#' @inheritParams QuartetStatus
#' @param Measure a function that calculates tree similarity or difference
#' from quartet statuses. Default is [`QuartetDivergence()`].
#' @return a matrix specifying the distance between each tree and
#' each other tree in the `trees`.
#'
#' @template MRS
#'
#' @examples
#' data("sq_trees")
#' # Calculate the status of each quartet relative to the first entry in
#' # sq_trees
#' sq_status <- QuartetStatus(sq_trees)
#'
#' # Calculate Estabrook et al's similarity measures:
#' SimilarityMetrics(sq_status)
#'
#' # Compare trees that include a subset of the taxa 1..10
#' library("TreeTools", quietly = TRUE, warn.conflict = FALSE)
#' QuartetStatus(BalancedTree(1:5), BalancedTree(3:8), nTip = 10)
#'
#' # If all taxa studied occur in `trees` or `cf`, set `nTip = TRUE`
#' QuartetStatus(BalancedTree(1:5), BalancedTree(3:10), nTip = TRUE)
#'
#' @family element-by-element comparisons
#' @seealso
#' - Use splits (groups/clades defined by nodes or edges of the tree) instead
#' of quartets as the unit of comparison: [`SplitStatus()`].
#'
#' - Generate distance metrics from quartet statuses: [`SimilarityMetrics()`].
#'
#' @references \insertAllCited{}
#' @export
PairwiseQuartets <- function(trees, Measure = QuartetDivergence) {
Measure(ManyToManyQuartetAgreement(trees))
}
1 change: 1 addition & 0 deletions R/QuartetDistance.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ WHICH_OTHER_NODE <- 2:4
#' PlotQuartet(sq_trees, c(2, 5, 3, 8), overwritePar = FALSE)
#' par(oPar)
#'
#' @family visualization
#' @importFrom graphics par plot legend
#' @importFrom TreeTools NTip RenumberTips
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/ResolvedQuartets.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#'
#' @template MRS
#'
#' @family quartet counting functions
#' @family enumeration
#'
#' @examples
#' data(sq_trees)
Expand Down
2 changes: 2 additions & 0 deletions R/TernaryPoints.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#'
#' @references \insertAllCited{}
#'
#' @family visualization
#' @template MRS
#'
#' @export
Expand Down Expand Up @@ -98,6 +99,7 @@ SymmetricDifferenceLineEnds <- function (nsd) {
#' @describeIn SymmetricDifferenceLineEnds Plot the lines onto the active ternary plot.
#' @param \dots Further parameters to pass to
#' \code{\link[Ternary:AddToTernary]{TernaryLines}()}.
#' @family visualization
#' @importFrom Ternary TernaryLines
#' @export
SymmetricDifferenceLines <- function (nsd, ...) { #nocov start
Expand Down
1 change: 1 addition & 0 deletions R/VisualizeQuartets.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#' # restore original graphical parameters
#' par(origPar)
#' @template MRS
#' @family visualization
#' @importFrom ape plot.phylo
#' @importFrom PlotTools SpectrumLegend
#' @importFrom viridisLite viridis
Expand Down
9 changes: 6 additions & 3 deletions R/tqDist.r
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
#' - Use splits (groups/clades defined by nodes or edges of the tree) instead
#' of quartets as the unit of comparison: [`SplitStatus()`].
#'
#' - Generate distance metrics from quartet statuses: [`SimilarityMetrics()`].
#' - Generate distance metrics from quartet statuses: [`SimilarityMetrics()`],
#' `[PairwiseQuartets()]`.
#'
#' @references \insertAllCited{}
#'
Expand Down Expand Up @@ -140,6 +141,7 @@ QuartetStatus <- function (trees, cf = trees[[1]], nTip = NULL) {
#' @importFrom ape write.tree
#' @template MRS
#' @useDynLib Quartet, .registration = TRUE
#' @family TQDist functions
#' @export
TQDist <- function (trees) {
.CheckSize(trees)
Expand Down Expand Up @@ -249,8 +251,8 @@ ManyToManyQuartetAgreement <- function (trees, nTip = NULL) {
}
}

#' @describeIn QuartetStatus Agreement of each quartet in trees in one list with
#' each quartet in trees in a second list.
#' @describeIn QuartetStatus Agreement of each quartet in trees in `trees1` with
#' each quartet in trees in `trees2`.
#' @param trees1,trees2 List or `multiPhylo` objects containing
#' trees of class `phylo`.
#' @return `TwoListQuartetAgreement()` returns a three-dimensional array listing,
Expand Down Expand Up @@ -367,6 +369,7 @@ TQFile <- function (treeList) {
#' @references \insertAllCited{}
#'
#' @concept Tree distances
#' @family TQDist functions
#' @name Distances
NULL

Expand Down
43 changes: 43 additions & 0 deletions inst/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
url: https://ms609.github.io/Quartet

authors:
Martin R. Smith:
href: https://smithlabdurham.github.io/

development:
mode: auto

reference:
- title: "Enumeration"
desc: >
Count quartets within trees
contents:
- has_concept("enumeration")

- title: "Comparison"
desc: >
Compare trees and quartet states
contents:
- has_concept("element-by-element comparisons")
- has_concept("tree comparison")

- title: "Visualization"
desc: >
Plot and display quartet statuses and differences
contents:
- has_concept("visualization")

- title: "Datasets"
desc: >
Example datasets for use with Quartet
contents:
- sq_trees
- has_concept("datasets")

- title: "TQDist wrappers"
desc: >
Direct access to TQDist functions
contents:
- has_concept("TQDist functions")


template:
bootstrap: 5
bslib:
Expand Down
4 changes: 2 additions & 2 deletions man/AllQuartets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/CompareQuartets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/CompareQuartetsMulti.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/CompareSplits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/Distances.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/PairSharedQuartetStatus.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading