ggdifftaxbar: significantly discriminative feature barplot

View source: R/plot-ggdiffbartaxa.R

ggdifftaxbarR Documentation

significantly discriminative feature barplot

Description

significantly discriminative feature barplot

Usage

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

## Not run: 
data(kostic2012crc)
kostic2012crc %<>% as.phyloseq()
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)
ggdifftaxbar(diffres, output="biomarker_barplot")

## End(Not run)

xiangpin/MicrobiotaProcess documentation built on Nov. 12, 2024, 2:05 p.m.