DAFOT (version 0.0.1)

DAFOT: Detector of Active Flow on a Tree

Description

DAFOT is a funtion used to detect the difference between two group of compositional data.

Usage

DAFOT(P, Q, Tree, times, alpha)

Arguments

P

A matrix. Compositional data of 1st group.

Q

A matrix. Compositional data of 2nd group.

Tree

A phylo class. Phylogenetic tree.

times

A integer. The times of permutation test.

alpha

A numeric. Significance level

Value

DAFOT returns an object of class dafot.

An object of class dafot is a list containing following components:

  • Stat the maximum of test statistics

  • PValue P value calculated from permutation test

  • StatThre the threshold for alpha level test

  • ActiveEdge the set of active edges

Details

This function is developed based on an optimal transport perspective. It can help detect the specific location of difference at a tree.

See Also

SCalculation

Examples

Run this code
# NOT RUN {
library(ape)
Tree=rtree(100)
alphaP=c(rep(1,length(Tree$tip.label)),rep(0,Tree$Nnode))
alphaQ=c(rep(1,length(Tree$tip.label)),rep(0,Tree$Nnode))
DataPQ<-DataGenerating(100,100,alphaP,alphaQ,1000)
DAFOT(DataPQ$P,DataPQ$Q,Tree,100,0.05)

##must install metagenomeFeatures from Bioconductor before trying this example
# }
# NOT RUN {
library(metagenomeFeatures)
gg85 <- get_gg13.8_85MgDb()
gamma_16S <- mgDb_select(gg85, type = "all", keys = "Gammaproteobacteria", keytype = "Class")
Tree=gamma_16S$tree
Tree$tip.label<-1:length(Tree$tip.label)
alphaP=c(rep(1,length(Tree$tip.label)),rep(0,Tree$Nnode))
alphaQ=c(rep(1,length(Tree$tip.label)),rep(0,Tree$Nnode))
alphaQ[1]=alphaQ[1]+1
DataPQ<-DataGenerating(100,100,alphaP,alphaQ,1000)
DAFOT(DataPQ$P,DataPQ$Q,Tree,100,0.05)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab