diff --git a/R/TreeManipulation.R b/R/TreeManipulation.R index b4f3f364..9dd89f60 100644 --- a/R/TreeManipulation.R +++ b/R/TreeManipulation.R @@ -1,4 +1,4 @@ -#' Unshift Tree +#' Add Tree to Start of List #' #' Add a tree to the start of a list of trees #' diff --git a/README.md b/README.md index 25f69706..75b67aa5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -[![Project Status: Inactive.](http://www.repostatus.org/badges/latest/inactive.svg)](http://www.repostatus.org/#inactive) +[![Project Status: Inactive.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive) [![Build Status](https://travis-ci.org/ms609/Quartet.svg?branch=master)](https://travis-ci.org/ms609/Quartet) [![codecov](https://codecov.io/gh/ms609/Quartet/branch/master/graph/badge.svg)](https://codecov.io/gh/ms609/Quartet) -[![CRAN Status Badge](http://www.r-pkg.org/badges/version/Quartet)](https://cran.r-project.org/package=Quartet) -[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/Quartet)](https://cran.r-project.org/package=Quartet) +[![CRAN Status Badge](https://www.r-pkg.org/badges/version/Quartet)](https://cran.r-project.org/package=Quartet) +[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/Quartet)](https://cran.r-project.org/package=Quartet) [![DOI](https://zenodo.org/badge/80424189.svg)](https://zenodo.org/badge/latestdoi/80424189) # Quartet diff --git a/cran-comments.md b/cran-comments.md index 74267b1e..052782e4 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,25 +2,30 @@ * local Windows 10 install, R 3.5.2 * win-builder, with `check_win_devel()` * Ubuntu 14.04.5 LTS, R 3.4 and devel, via [Travis CI](https://travis-ci.org/ms609/Quartet) -* R-hub, with `check_rhub()` +* R-hub, with `check_rhub(platforms = platforms())` * Installation failed with PREPERROR on rhub/ubuntu-gcc-release and - rhub/fedora-clang-devel, on account of failures to install the required - packages (`phangorn`; `git2r`). This seems to be an issue outside - of my control; the Debian rhub installation reports success. - + rhub/fedora-clang-devel (and other platforms), on account of failures + to install a required dependency (`phangorn`). + This seems to be an issue outside of my control. + * Installation failed with ERROR on ubuntu-gcc-devel and debian-gcc-patched: + > "there is no package called `lattice`" + The failure to install the dependency `lattice` seems to be outwith my + control. ## R CMD check results There were no ERRORs or WARNINGs. -There was 1 NOTE: +There was one NOTE: + + > Days since last update: 6 -* checking CRAN incoming feasibility ... NOTE - Maintainer: 'Smith Martin R. ' - - New submission - -This package is a new submission. +This release comes on the heels of v1.0.0 on 2019-01-16, which failed +certain CRAN package checks -- Brian Ripley requested that these be fixed +immediately and kindly proposed some suggestions for how portability could be +improved. +After implementing these and testing the relevant platforms using `check_rhub`, +I believe that the issues have been resolved. ## Downstream dependencies There are currently no downstream dependencies for this package. diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib index 1178ad16..9c0f6d7d 100644 --- a/inst/REFERENCES.bib +++ b/inst/REFERENCES.bib @@ -1,3 +1,60 @@ +@article{Bluis2003, + author = {Bluis, John and Shin, Dong Guk}, + doi = {10.1109/BIBE.2003.1188933}, + journal = {Proceedings - 3rd IEEE Symposium on BioInformatics and BioEngineering, BIBE 2003}, + pages = {87--94}, + publisher = {IEEE}, + title = {{Nodal distance algorithm: Calculating a phylogenetic tree comparison metric}}, + year = {2003} +} + +@incollection{Bocker2013, + address = {Berlin, Heidelberg}, + author = {B{\"{o}}cker, Sebastian and Canzar, Stefan and Klau, Gunnar W.}, + booktitle = {Algorithms in Bioinformatics. WABI 2013. Lecture Notes in Computer Science, vol 8126}, + doi = {10.1007/978-3-642-40453-5_13}, + editor = {Darling, A. and Stoye, J.}, + pages = {156--169}, + publisher = {Springer}, + title = {{The generalized Robinson-Foulds metric}}, + year = {2013} +} + + +@article{Bogdanowicz2012, + author = {Bogdanowicz, Damian and Giaro, Krzysztof}, + doi = {10.1109/TCBB.2011.48}, + issn = {15455963}, + journal = {IEEE/ACM Transactions on Computational Biology and Bioinformatics}, + number = {1}, + pages = {150--160}, + title = {{Matching split distance for unrooted binary phylogenetic trees}}, + volume = {9}, + year = {2012} +} + +@article{Bogdanowicz2013, + author = {Bogdanowicz, Damian and Giaro, Krzysztof}, + doi = {10.2478/amcs-2013-0050}, + journal = {International Journal of Applied Mathematics and Computer Science}, + number = {3}, + pages = {669--684}, + title = {{On a matching distance between rooted phylogenetic trees}}, + volume = {23}, + year = {2013} +} + +@article{Bogdanowicz2017, + author = {Bogdanowicz, Damian and Giaro, Krzysztof}, + doi = {10.1089/cmb.2016.0204}, + journal = {Journal of Computational Biology}, + number = {5}, + pages = {422--435}, + title = {{Comparing phylogenetic trees by matching nodes using the transfer distance between partitions}}, + volume = {24}, + year = {2017} +} + @article{Brodal2013, author = {Brodal, Gerth St{\o}lting and Fagerberg, Rolf and Mailund, Thomas and Pedersen, Christian N. S. and Sand, Andreas}, doi = {10.1137/1.9781611973105.130}, @@ -61,6 +118,17 @@ @article{Marczewski1958 year = {1958} } +@article{Nye2006, + author = {Nye, Tom M W and Li{\`{o}}, Pietro and Gilks, Walter R.}, + doi = {10.1093/bioinformatics/bti720}, + journal = {Bioinformatics}, + number = {1}, + pages = {117--119}, + title = {{A novel algorithm and web-based tool for comparing two alternative phylogenetic trees}}, + volume = {22}, + year = {2006} +} + @article{Penny1985, author = {Penny, David and Hendy, M. D.}, doi = {10.2307/2413347}, diff --git a/man/UnshiftTree.Rd b/man/UnshiftTree.Rd index 2191d2ce..d2ca7e9f 100644 --- a/man/UnshiftTree.Rd +++ b/man/UnshiftTree.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/TreeManipulation.R \name{UnshiftTree} \alias{UnshiftTree} -\title{Unshift Tree} +\title{Add Tree to Start of List} \usage{ UnshiftTree(add, treeList) } diff --git a/src/int_stuff.h b/src/int_stuff.h index cd4fbc99..428c8e3a 100644 --- a/src/int_stuff.h +++ b/src/int_stuff.h @@ -3,8 +3,8 @@ #define INT_STUFF_H #if __cplusplus <= 199711L - #define INTTYPE_N4 long long // fails -pedantic - #define INTTYPE_REST long long // fails -pedantic + #define INTTYPE_N4 long int // long long fails -pedantic + #define INTTYPE_REST long int // long long fails -pedantic #else #include #define INTTYPE_N4 int_fast64_t // long long fails -pedantic diff --git a/src/rQuartetDist.cpp b/src/rQuartetDist.cpp index c17b1b07..a04131dc 100644 --- a/src/rQuartetDist.cpp +++ b/src/rQuartetDist.cpp @@ -1,12 +1,9 @@ #include using namespace Rcpp; -#include "int_stuff.h" +#include "int_stuff.h" #include "QuartetDistanceCalculator.h" -#include -#include -#include #include //' Triplet and quartet distances with tqDist diff --git a/src/rTripletDist.cpp b/src/rTripletDist.cpp index c09ca3e5..a8c82e02 100644 --- a/src/rTripletDist.cpp +++ b/src/rTripletDist.cpp @@ -1,13 +1,9 @@ #include using namespace Rcpp; -#include "int_stuff.h" +#include "int_stuff.h" #include "TripletDistanceCalculator.h" -#include -#include -#include -#include #include //' @describeIn tqdist_QuartetDistance Triplet distance between two trees diff --git a/vignettes/Tree-distance-metrics.Rmd b/vignettes/Tree-distance-metrics.Rmd index 9d711d53..54c13d82 100644 --- a/vignettes/Tree-distance-metrics.Rmd +++ b/vignettes/Tree-distance-metrics.Rmd @@ -74,6 +74,8 @@ each pair of tips. The path difference metric [@Steel1993; `r Phangorn('path.dist')`] is the square root of the sum of squares of each of these differences. +The related nodal distance [@Bluis2003] is not considered further here. + ## Partition metric The Robinson-Foulds (RF or 'partition') metric [@Robinson1981; @Steel1993; phangorn's `r Phangorn('RF.dist')` or this package's `RobinsonFoulds`] @@ -372,5 +374,33 @@ all of the following desiderata: - Identifies pairs of trees that are more random than expected by chance - Does not reach its maximum value after relatively trivial rearrangements +# Improvements to partition metrics + +The primary issue with the Robinson-Foulds distance is its conservative +pairing of clades: a grouping is either identical in both trees, or is +treated as different. +This makes no account for the possibility that one tree contains a grouping that +is similar (though not quite identical) to a grouping in another. + +In order to incorporate some measure of similar-but-not-quite-identical clades, +it is necessary to construct an optimal matching that pairs each clade in each +tree with either a suitable clade in the other, or with no clade at all. + +Various approaches to this problem have been proposed; these typically search +for a matching that minimises the total dissimilarity summed for all pairings. +Approaches differ in how they penalize differences between paired groups. +Bogdanowicz and Giaro [-@Bogdanowicz2012;-@Bogdanowicz2013;-@Bogdanowicz2017] +calculate the size +of the largest bipartition that is consistent with both input groups; +Nye _et al_. [-@Nye2006] normalize this number using the Jaccard index; +Böcker _et al_. [-@Bocker2013] raise this value to an arbitrary exponent, and +add a constraint that prohibits pairings that comprise contradictory groups. + +These approaches represent a refinement of the Robinson-Foulds metric, +circumventing many of the issues raised above. They are, however, more +computationally expensive, and lack an objective measure of clade similarity. +I am not presently aware of an R implementation of any of these measures, +though a related metric is planned for a future version of this package. + # References \ No newline at end of file