check_tree_clustering: Check for clustering on tree

Description Usage Arguments Value Examples

View source: R/check_clustering_on_tree.R

Description

This function is used to test for clustering of a certain epi factor on a phylogenetic tree.

Usage

1
2
3
4
5
6
7
check_tree_clustering(
  tree,
  isolate_labels,
  nperm = 1000,
  control_labels = NULL,
  plot_path = "cluster.pdf"
)

Arguments

tree

Tree to look for clustering on.

isolate_labels

Named vector of labels by which pure clusters are defined. Names must be equivalent to tree tip label names.

nperm

Number of permutations to perform.

control_labels

Named vector of labels known to cluster. Names must be equivalent to tree tip label names. This controls for clustering by requiring that the pure clusters must contain multiple of the control labels.

plot_path

Path to output histogram. No plot created if NA.

Value

Vector of real (1st element) and permuted (all other elements) pure cluster sizes.

Examples

1
2
3
4
tree = ape::rtree(50)
labs = sample(c(0,1),50,replace=TRUE)
names(labs) = tree$tip.label
check_tree_clustering(tree,labs,nperm=10)

Snitkin-Lab-Umich/snitkitr documentation built on April 21, 2021, 10:48 a.m.