Last data update: 2014.03.03

R: Define clade
define.cladeR Documentation

Define clade

Description

Function to define groups (clades) in a phylogenetic tree.

Usage

define.clade(tree, threshold, time, method = c("threshold", "time"))

Arguments

tree

Phylogenetic tree.

threshold

A threshold value to form the groups.

time

A cutting height (age) to form the groups.

method

Method to define the clades, "threshold" or "time".

Details

In the method threshold the total length of phylogenetic tree is used as cutting factor. If threshold is near to zero the cutting is near the root, if threshold near to one cutting is near the tips.

The phylogenetic tree must contain the node labels for the function work. Use the makeNodeLabel for defining node labels in a flexible way.

Value

clades

Tips and their clades.

height

The cutting height.

Author(s)

Vanderlei Julio Debastiani <vanderleidebastiani@yahoo.com.br>

See Also

makeNodeLabel

Examples


require(ape)	
tree<-makeNodeLabel(rcoal(20))
clades<-define.clade(tree, threshold = 0.8, method = "threshold")
clades
plot.phylo(tree, show.node.label = TRUE)
abline(v = clades$height)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PCPS)
Loading required package: SYNCSA
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-0
Loading required package: mice
Loading required package: Rcpp
mice 2.25 2015-11-09
Loading required package: FD
Loading required package: ade4

Attaching package: 'ade4'

The following object is masked from 'package:vegan':

    cca

Loading required package: ape
Loading required package: geometry
Loading required package: magic
Loading required package: abind
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PCPS/define.clade.Rd_%03d_medium.png", width=480, height=480)
> ### Name: define.clade
> ### Title: Define clade
> ### Aliases: define.clade
> ### Keywords: PCPS
> 
> ### ** Examples
> 
> 
> require(ape)	
> tree<-makeNodeLabel(rcoal(20))
> clades<-define.clade(tree, threshold = 0.8, method = "threshold")
> clades
$clades
     t9      t2      t7      t6      t5     t12     t16     t10     t13      t8 
"Node9" "Node9" "Node9" "Node9" "Node6" "Node6" "Node6" "Node6" "Node6" "Node6" 
    t14     t17     t19      t3      t4     t11     t15     t18      t1     t20 
"Node5" "Node5" "Node5" "Node5" "Node5" "Node5" "Node5" "Node5" "Node4" "Node4" 

$height
[1] 2.847972

> plot.phylo(tree, show.node.label = TRUE)
> abline(v = clades$height)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>