ggdiffclade: plot the clade tree with highlight

Description Usage Arguments Value Author(s) Examples

View source: R/plot-ggdiffclade.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
ggdiffclade(obj, ...)

## S3 method for class 'data.frame'
ggdiffclade(
  obj,
  nodedf,
  factorName,
  layout = "circular",
  linewd = 0.6,
  skpointsize = 0.8,
  alpha = 0.4,
  taxlevel = 6,
  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", "radial", "slanted", "inward_circular" and "circular" in here, default is circular.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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=3,
#                        setColors=FALSE) +
#        scale_fill_manual(values=c('#00AED7', 
#                                   '#FD9347', 
#                                   '#C1E168'))

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.