lefserPlot function displays effect sizes for differentially expressed microorganisms and whether they are more abundant in '0' or '1' sample group.

lefserPlot(df, colors = c("red", "forestgreen"), trim.names = TRUE)

Arguments

df

Data frame produced by lefser.

colors

character(2) The two colors corresponding to class 0 and 1, respectively. Defaults to c("red", "forestgreen").

trim.names

If TRUE extracts the most specific taxonomic rank of organism.

Value

Function returns plot of effect size scores produed by lefser. Positive scores represent microorganisms with that are more abundant in class '1'. Negative scores represent microorganisms with that are more abundant in class '0'.

Examples

example("lefser")
#> 
#> lefser>     # (1) Using classes only
#> lefser>     data(zeller14)
#> 
#> lefser>     # exclude 'adenoma'
#> lefser>     zeller14 <- zeller14[, zeller14$study_condition != "adenoma"]
#> 
#> lefser>     res_group <- lefser(zeller14, groupCol = "study_condition")
#> Warning: Convert counts to relative abundances with 'relativeAb()'
#> The outcome variable is specified as 'study_condition' and the reference category is 'CRC'.
#>  See `?factor` or `?relevel` to change the reference category.
#> 
#> lefser>     head(res_group)
#>                                                                                                                                 Names
#> 1                                                                                         k__Bacteria|p__Bacteroidetes|c__Bacteroidia
#> 2                                                                        k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales
#> 3                                                                                                        k__Bacteria|p__Bacteroidetes
#> 4                                                  k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae
#> 5 k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Coprococcus|s__Coprococcus_eutactus|t__GCF_000154425
#> 6                  k__Bacteria|p__Firmicutes|c__Clostridia|o__Clostridiales|f__Lachnospiraceae|g__Coprococcus|s__Coprococcus_eutactus
#>      scores
#> 1 -6.406226
#> 2 -6.406226
#> 3 -6.406201
#> 4 -5.758285
#> 5 -5.638205
#> 6 -5.593375
#> 
#> lefser>     # (2) Using classes and sublasses
#> lefser>     data(zeller14)
#> 
#> lefser>     # exclude 'adenoma'
#> lefser>     zeller14 <- zeller14[, zeller14$study_condition != "adenoma"]
#> 
#> lefser>     res_block <- lefser(
#> lefser+          zeller14, groupCol = "study_condition", blockCol = "age_category"
#> lefser+     )
#> Warning: Convert counts to relative abundances with 'relativeAb()'
#> The outcome variable is specified as 'study_condition' and the reference category is 'CRC'.
#>  See `?factor` or `?relevel` to change the reference category.
#> 
#> lefser>     head(res_block)
#>                                                                                                                                  Names
#> 1                                                  k__Bacteria|p__Fusobacteria|c__Fusobacteriia|o__Fusobacteriales|f__Fusobacteriaceae
#> 2                                 k__Bacteria|p__Fusobacteria|c__Fusobacteriia|o__Fusobacteriales|f__Fusobacteriaceae|g__Fusobacterium
#> 3                                  k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Porphyromonas
#> 4                                                                                                          k__Bacteria|p__Fusobacteria
#> 5                                                                      k__Bacteria|p__Fusobacteria|c__Fusobacteriia|o__Fusobacteriales
#> 6 k__Bacteria|p__Bacteroidetes|c__Bacteroidia|o__Bacteroidales|f__Porphyromonadaceae|g__Porphyromonas|s__Porphyromonas_asaccharolytica
#>      scores
#> 1 -5.331489
#> 2 -5.232178
#> 3 -5.051428
#> 4 -4.924990
#> 5 -4.923957
#> 6 -4.922982
lefserPlot(res_group)