ggdifftaxbar: significantly discriminative feature barplot

Description Usage Arguments Value Author(s) Examples

View source: R/plot-ggdiffbartaxa.R

Description

significantly discriminative feature barplot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ggdifftaxbar(obj, ...)

ggdiffbartaxa(obj, ...)

## S4 method for signature 'diffAnalysisClass'
ggdifftaxbar(
  obj,
  filepath = NULL,
  output = "biomarker_barplot",
  removeUnknown = TRUE,
  figwidth = 6,
  figheight = 3,
  ylabel = "relative abundance",
  format = "pdf",
  dpi = 300,
  ...
)

## S3 method for class 'featureMeanMedian'
ggdifftaxbar(
  obj,
  featurename,
  classgroup,
  subclass,
  xtextsize = 3,
  factorLevels = NULL,
  coloslist = NULL,
  ylabel = "relative abundance",
  ...
)

Arguments

obj

object, diffAnalysisClass see also diff_analysis or feMeanMedian class, see also get_mean_median.

...

additional arguments.

filepath

character, default is NULL, meaning current path.

output

character, the output dir name, default is "biomarker_barplot".

removeUnknown

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

figwidth

numeric, the width of figures, default is 6.

figheight

numeric, the height of figures, default is 3.

ylabel

character, the label of y, default is 'relative abundance'.

format

character, the format of figure, default is pdf, png, tiff also be supported.

dpi

numeric, the dpi of output, default is 300.

featurename

character, the feature name, contained at the objet.

classgroup

character, factor name.

subclass

character, factor name.

xtextsize

numeric, the size of axis x label, default is 3.

factorLevels

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

coloslist

vector, color vector, if the input is phyloseq, you should use this to adjust the color, not scale_color_manual.

Value

the figures of features show the distributions in samples.

Author(s)

Shuangbin Xu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)
# not run in example
#ggdifftaxbar(diffres, output="biomarker_barplot")

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