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 = "radial",
      linewd = 0.6,
      skpointsize = 0.8,
      alpha = 0.4,
      taxlevel = 5,
      cladetext = 2,
      factorLevels = NULL,
      setColors = TRUE,
      xlim = 12,
      reduce = FALSE,
      type = "species",
      ...
    )

    ## S3 method for class 'diffAnalysisClass'
    ggdiffclade(obj, removeUnknown = 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", "roundrect", "ellipse", "radial", "slanted", "inward_circular" and "circular" in here, default is "radial".
`linewd` | 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.
`xlim` | numeric, the x limits, only works for 'inward_circular' layout, default is 12.
`reduce` | logical, whether remove the unassigned taxonomy, which will remove the clade of unassigned taxonomy, but the result of 'diff_analysis' should remove the unknown taxonomy, default is FALSE.
`type` | character, the type of datasets, default is "species", if the dataset is not about species, such as dataset of kegg function, you should set it to "others".
`removeUnknown` | logical, whether do not show unknown taxonomy, default is TRUE.

### Value

figures of tax clade show the significant different feature.

### Author(s)

Shuangbin Xu

### Examples

    ## Not run:
    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, linewd=0.2,
                            skpointsize=0.4,
                            taxlevel=5,
                            setColors=FALSE) +
            scale_fill_manual(values=c('#00AED7',
                                       '#FD9347',
                                       '#C1E168'))

    ## End(Not run)

[Package MicrobiotaProcess version 1.4.4 Index]