ggdiffclade {MicrobiotaProcess}R Documentation

plot the clade tree with highlight

Description

plot results of different analysis or data.frame, contained hierarchical relationship or other classes,such like the tax_data of phyloseq.

Usage

ggdiffclade(obj, ...)

## S3 method for class 'data.frame'
ggdiffclade(
  obj,
  nodedf,
  factorName,
  layout = "circular",
  size = 0.6,
  skpointsize = 0.8,
  alpha = 0.4,
  taxlevel = 6,
  cladetext = 2,
  factorLevels = NULL,
  setColors = TRUE,
  ...
)

## S3 method for class 'diffAnalysisClass'
ggdiffclade(obj, removeUnkown = TRUE, ...)

Arguments

obj

object, diffAnalysisClass, the results of diff_analysis see also diff_analysis, or data.frame, contained hierarchical relationship or other classes.

...,

additional parameters.

nodedf

data.frame, contained the tax and the factor information and(or pvalue).

factorName

character, the names of factor in nodedf.

layout

character, the layout of ggtree, but only "rectangular" , "radial", "slanted" and "circular" in here, default is circular.

size

numeric, the size of segment of ggtree, default is 0.6.

skpointsize

numeric, the point size of skeleton of tree, default is 0.8 .

alpha

numeric, the alpha of clade, default is 0.4.

taxlevel

positive integer, the full text of clade, default is 5.

cladetext

numeric, the size of text of clade, default is 2.

factorLevels

list, the levels of the factors, default is NULL, if you want to order the levels of factor, you can set this.

setColors

logical, whether set the color of clade, default is TRUE, or set FALSE,then use 'scale_fill_manual' setting.

removeUnkown

logical, whether do not show unkown taxonomy, default is TRUE.

Value

figures of tax clade show the significant different feature.

Author(s)

Shuangbin Xu

Examples

data(kostic2012crc)
kostic2012crc
head(phyloseq::sample_data(kostic2012crc),3)
kostic2012crc <- phyloseq::rarefy_even_depth(kostic2012crc,
                         rngseed=1024)
table(phyloseq::sample_data(kostic2012crc)$DIAGNOSIS)
set.seed(1024)
diffres <- diff_analysis(kostic2012crc, classgroup="DIAGNOSIS",
                        mlfun="lda", filtermod="fdr",
                        firstcomfun = "kruskal.test",
                        firstalpha=0.05, strictmod=TRUE,
                        secondcomfun = "wilcox.test",
                        subclmin=3, subclwilc=TRUE,
                        secondalpha=0.01, ldascore=3)
#library(ggplot2)
#diffcladeplot <- ggdiffclade(diffres,alpha=0.3, size=0.2, 
#                        skpointsize=0.4, 
#                        taxlevel=3,
#                        setColors=FALSE) +
#        scale_fill_manual(values=c('#00AED7', 
#                                   '#FD9347', 
#                                   '#C1E168'))

[Package MicrobiotaProcess version 1.0.5 Index]