PhyCA: Performs Phylogenetic Principal Components Analysis

View source: R/PhyCA.R

PhyCAR Documentation

Performs Phylogenetic Principal Components Analysis

Description

Performs Phylogenetic Principal Components Analysis

Usage

PhyCA(Data, tree, ncores = NULL, ncomponents = NULL,
  output.edges = F, tol = 1e-05, quiet = T, ...)

Arguments

Data

Positive-valued data matrix whose rownames are tip-labels in the input tree.

tree

phylo-class object whose tip-labels cover the rownames of Data.

ncores

optional number of cores for built-in parallelization. Be cautious of memory - each worker is sent a copy of the dataset and tree, producing ncores+1 copies of the dataset & tree.

ncomponents

integer indicating number of phylogenetic components to extract

output.edges

Logical, whether or not to output the edges in the input tree corresponding to phylogenetic components

tol

tolerance for compositional matrix. Rounding error in large datasets can lead to columns of compositional data not summing to 1.

quiet

Logical, whether or not to quiet warnings.

...

additional input arguments to PhyloFactor

Value

PhyCA object containing Data, tree, basis, and edges of the phylogeny corresponding to each split.

Examples


library(phylofactor)
data("FTmicrobiome")

Data <- FTmicrobiome$PF$Data
tree <- FTmicrobiome$PF$tree
X <- FTmicrobiome$X
taxonomy <- FTmicrobiome$taxonomy
clr <- function(A) apply(A,MARGIN=2,FUN=function(a) log(a)-mean(log(a)))
pf.heatmap(tree=tree,Data=clr(Data))


phca <- PhyCA(Data,tree,ncomponents = 2)
phcaPAR <- PhyCA(Data,tree,ncomponents=2,ncores=2)

pf.heatmap(phca,factors=1:2)

reptalex/phylofactor documentation built on Feb. 28, 2024, 3:19 p.m.