PhyCA | R Documentation |
Performs Phylogenetic Principal Components Analysis
PhyCA(Data, tree, ncores = NULL, ncomponents = NULL,
output.edges = F, tol = 1e-05, quiet = T, ...)
Data |
Positive-valued data matrix whose rownames are tip-labels in the input |
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 |
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 |
PhyCA object containing Data, tree, basis, and edges of the phylogeny corresponding to each split.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.