ridges_pq: Ridge plot of a phyloseq object

View source: R/plot_functions.R

ridges_pqR Documentation

Ridge plot of a phyloseq object

Description

lifecycle-experimental

Graphical representation of distribution of taxa across a factor using ridges.

Usage

ridges_pq(
  physeq,
  fact,
  nb_seq = TRUE,
  log10trans = TRUE,
  tax_level = "Class",
  ...
)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

fact

(required) Name of the factor in physeq@sam_data used to plot different lines

nb_seq

(logical; default TRUE) If set to FALSE, only the number of ASV is count. Concretely, physeq otu_table is transformed in a binary otu_table (each value different from zero is set to one)

log10trans

(logical, default TRUE) If TRUE, the number of sequences (or ASV if nb_seq = FALSE) is log10 transformed.

tax_level

The taxonomic level to fill ridges

...

Other params passed on to ggridges::geom_density_ridges()

Value

A ggplot2 plot with bar representing the number of sequence en each taxonomic groups

Author(s)

Adrien Taudière

Examples

if (requireNamespace("ggridges")) {
  ridges_pq(data_fungi_mini, "Time", alpha = 0.5, log10trans = FALSE) + xlim(c(0, 1000))
}

if (requireNamespace("ggridges")) {
  ridges_pq(data_fungi_mini, "Time", alpha = 0.5, scale = 0.9)
  ridges_pq(data_fungi_mini, "Sample_names", log10trans = TRUE) + facet_wrap("~Height")

  ridges_pq(data_fungi_mini,
    "Time",
    jittered_points = TRUE,
    position = ggridges::position_points_jitter(width = 0.05, height = 0),
    point_shape = "|", point_size = 3, point_alpha = 1, alpha = 0.7,
    scale = 0.8
  )
}


adrientaudiere/MiscMetabar documentation built on Oct. 13, 2024, 9:42 p.m.