Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ms609/SlowQuartet
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Smith committed Jan 22, 2019
2 parents 67698c6 + 70385f8 commit cb98c5d
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 28 deletions.
2 changes: 1 addition & 1 deletion R/TreeManipulation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Unshift Tree
#' Add Tree to Start of List
#'
#' Add a tree to the start of a list of trees
#'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
29 changes: 17 additions & 12 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. <[email protected]>'
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.
68 changes: 68 additions & 0 deletions inst/REFERENCES.bib
Original file line number Diff line number Diff line change
@@ -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},
Expand Down Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion man/UnshiftTree.Rd

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

4 changes: 2 additions & 2 deletions src/int_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstdint>
#define INTTYPE_N4 int_fast64_t // long long fails -pedantic
Expand Down
5 changes: 1 addition & 4 deletions src/rQuartetDist.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#include <Rcpp.h>
using namespace Rcpp;
#include "int_stuff.h"

#include "int_stuff.h"
#include "QuartetDistanceCalculator.h"

#include <R.h>
#include <Rdefines.h>
#include <Rinternals.h>
#include <vector>

//' Triplet and quartet distances with tqDist
Expand Down
6 changes: 1 addition & 5 deletions src/rTripletDist.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#include <Rcpp.h>
using namespace Rcpp;
#include "int_stuff.h"

#include "int_stuff.h"
#include "TripletDistanceCalculator.h"

#include <R.h>
#include <Rdefines.h>
#include <Rinternals.h>
#include <cstdlib>
#include <vector>

//' @describeIn tqdist_QuartetDistance Triplet distance between two trees
Expand Down
30 changes: 30 additions & 0 deletions vignettes/Tree-distance-metrics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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`]
Expand Down Expand Up @@ -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

0 comments on commit cb98c5d

Please sign in to comment.