relabu_barplot {animalcules} | R Documentation

## Plot bar plots of sample and group level relative abundance

### Description

Plot bar plots of sample and group level relative abundance

### Usage

    relabu_barplot(
      MAE,
      tax_level,
      order_organisms = c(),
      sort_by = c("nosort", "conditions", "organisms", "alphabetically"),
      group_samples = FALSE,
      group_conditions = "ALL",
      sample_conditions = c(),
      isolate_samples = c(),
      discard_samples = c(),
      show_legend = TRUE
    )

### Arguments

`MAE` | A multi-assay experiment object
`tax_level` | The taxon level used for organisms
`order_organisms` | A character list of organisms to send to top
`sort_by` | Sort bars by one of c("nosort", "conditions", "organisms", "alphabetically")
`group_samples` | A bool specifying whether to group samples
`group_conditions` | Group by one or more conditions e.g. "ALL" or "SEX"
`sample_conditions` | Plot associatied conditions with samples.
`isolate_samples` | Isolate specific samples e.g. c("SAM_01", "SAM_02")
`discard_samples` | Discard specific samples e.g. c("SAM_01", "SAM_02")
`show_legend` | A bool specifying whether or not to show organisms legend

### Value

A plotly object

### Examples

    data_dir = system.file("extdata/MAE.rds", package = "animalcules")
    toy_data <- readRDS(data_dir)
    p <- relabu_barplot(toy_data,
                        tax_level="family",
                        order_organisms=c('Retroviridae'),
                        sort_by="organisms",
                        sample_conditions=c('SEX', 'AGE'),
                        show_legend=TRUE)
    p

[Package animalcules version 1.8.1 Index]