amp_diffabund: Differential abundance test

Description Usage Arguments Value Author(s) Examples

View source: R/amp_diffabund.R

Description

Tests if there is a significant difference in abundances between samples or groups hereof based on selected conditions. Returns a list containing test results as well as two different plots; an MA-plot and an abundance plot with taxa with the most significant p-value (below the threshold).

Usage

1

Arguments

data

(required) Data list as loaded with amp_load().

group

(required) A categorical variable in the metadata that defines the sample groups to test.

test

The name of the test to use, either "Wald} or \code{"LRT. See DESeq. (default: "Wald")

fitType

The type of fitting of dispersions to the mean intensity, either "parametric", "local", or "mean". (default: "parametric")

num_threads

The number of threads to use for parallelization by the BiocParallel backend. Parallelization is not supported on windows machines. (default: 1)

signif_thrh

Significance threshold. (default: 0.01)

fold

Log2fold filter for displaying significant results. (default: 0)

verbose

(Logical) Whether to print status messages during the test calculations. (Default: TRUE)

signif_plot_type

Either "boxplot" or "point". (default: "point")

plot_nshow

The amount of the most significant results to display in the most-significant plot. (default: 10)

plot_point_size

The size of the plotted points. (default: 2)

tax_aggregate

The taxonomic level to aggregate the OTUs. (default: "OTU")

tax_add

Additional taxonomic level(s) to display, e.g. "Phylum". (default: NULL)

tax_class

Converts a specific phylum to class level instead, e.g. "p__Proteobacteria".

tax_empty

How to show OTUs without taxonomic information. One of the following:

  • "remove": Remove OTUs without taxonomic information.

  • "best": (default) Use the best classification possible.

  • "OTU": Display the OTU name.

adjust_zero

Keep 0 abundances in ggplot2 median calculations by adding a small constant to these.

...

Additional arguments passed on to DESeq.

Value

A list with multiple elements:

Author(s)

Kasper Skytte Andersen kasperskytteandersen@gmail.com

Mads Albertsen MadsAlbertsen85@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(ampvis2extras)
# Load example data
data("AalborgWWTPs")

# Subset to a few taxa, save the results in an object
d <- amp_subset_taxa(AalborgWWTPs, tax_vector = c("p__Chloroflexi", "p__Actinobacteria"))
results <- amp_diffabund(d, group = "Plant", tax_aggregate = "Genus")

# Show plots
results$plot_signif
results$plot_MA

# Or show raw results
results$Clean_results

KasperSkytte/ampvis2extras documentation built on Oct. 3, 2021, 11:38 a.m.