kdetrees: Identify discordant trees in a sample

Description Usage Arguments Details Value Author(s) Examples

View source: R/kde.R

Description

Analyze a set of phylogenetic trees and attempt to identify trees which are significantly discordant with other trees in the sample (outlier trees).

Usage

1
2
kdetrees(trees, k = 1.5, distance = c("geodesic", "dissimilarity"),
  outgroup = NULL, topo.only = FALSE, bw = list(), greedy = FALSE, ...)

Arguments

trees

multiPhylo object

k

IQR multiplier for outlier detection

distance

Select "geodesic" or "dissimilarity" distance calculation method

outgroup

if a character, reroot all trees with this species as outgroup. The geodesic distance method requires rooted trees.

topo.only

set all branch lengths to 1 before analyzing?

bw

see Details

greedy

greedy outlier detection?

...

additional arguments for distance calculation function, see details

Details

If bw is a single number, it will be used as a single constant bandwidth. It can also be a vector, in which case it will be used as variable bandwidths for each tree, repectively. Finally, if it is a list (default), the list will be passed as arguments to the bw.nn adaptive bandwith function.

... Is passed to either distory::dist.multiPhylo or dist.diss, as appropriate. See the help for these functions for more details.

Value

a kdetrees object; list(density,outliers)

Author(s)

Grady Weyenberg

Examples

1
2
3
4
5
kdeobj <- kdetrees(apicomplexa)
print(kdeobj)
kdeobj$outliers

kdetrees(apicomplexa, k=2.0, distance="dissimilarity",topo.only=FALSE)

Example output

Call: kdetrees(trees = apicomplexa)
Density estimates:
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
  0.9963  65.8651  82.6407  77.2972  94.4934 114.5458 
Cutoff:  22.92261 

Outliers detected:
 [1] 488.tre 497.tre 515.tre 546.tre 547.tre 641.tre 660.tre 662.tre 728.tre
[10] 747.tre 773.tre 780.tre
12 phylogenetic trees
Call: kdetrees(trees = apicomplexa, k = 2, distance = "dissimilarity", 
    topo.only = FALSE)
Density estimates:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.3732 19.5469 24.4732 23.1004 29.0376 35.2785 
Cutoff:  0.5653973 

Outliers detected:
[1] 497.tre 515.tre 546.tre 547.tre 662.tre 728.tre 747.tre 773.tre 780.tre

kdetrees documentation built on May 1, 2019, 9:35 p.m.