plot_deseq2_pq: Plot DESeq2 results for a phyloseq or a DESeq2 object.

View source: R/Deseq2_edgeR.R

plot_deseq2_pqR Documentation

Plot DESeq2 results for a phyloseq or a DESeq2 object.

Description

lifecycle-experimental

Graphical representation of DESeq2 analysis.

Usage

plot_deseq2_pq(
  data,
  contrast = NULL,
  tax_table = NULL,
  pval = 0.05,
  taxolev = "Genus",
  select_taxa = NULL,
  color_tax = "Phylum",
  tax_depth = NULL,
  verbose = TRUE,
  jitter_width = 0.1,
  ...
)

Arguments

data

(required) a phyloseq-class or a DESeqDataSet-class object.

contrast

(required) contrast specifies what comparison to extract from the object to build a results table. See results man page for more details.

tax_table

Required if data is a DESeqDataSet-class object. The taxonomic table used to find the taxa and color_taxa arguments. If data is a phyloseq-class object, data@tax_table is used.

pval

(default: 0.05) the significance cutoff used for optimizing the independent filtering. If the adjusted p-value cutoff (FDR) will be a value other than 0.05, pval should be set to that value.

taxolev

taxonomic level of interest

select_taxa

Either the name of the taxa (in the form of DESeq2::results()) or a logical vector (length of the results from DESeq2::results()) to select taxa to plot.

color_tax

taxonomic level used for color or a color vector.

tax_depth

Taxonomic depth to test for differential distribution among contrast. If Null the analysis is done at the OTU (i.e. Species) level. If not Null, data need to be a column name in the tax_table slot of the phyloseq-class object.

verbose

whether the function print some information during the computation

jitter_width

width for the jitter positioning

...

Additional arguments passed on to DESeq or ggplot

Details

Please cite DESeq2 package if you use chis function.

Value

A ggplot2 plot representing DESeq2 results

Author(s)

Adrien Taudière

See Also

DESeq

results

plot_edgeR_pq

Examples



data("GlobalPatterns", package = "phyloseq")
GP <- subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
GP <- subset_samples(GP, SampleType %in% c("Soil", "Skin"))
if (requireNamespace("DESeq2")) {
  res <- DESeq2::DESeq(phyloseq_to_deseq2(GP, ~SampleType),
    test = "Wald", fitType = "local"
  )
  plot_deseq2_pq(res, c("SampleType", "Soil", "Skin"),
    tax_table = GP@tax_table, color_tax = "Kingdom"
  )
  plot_deseq2_pq(res, c("SampleType", "Soil", "Skin"),
    tax_table = GP@tax_table, color_tax = "Kingdom",
    pval = 0.7
  )
  plot_deseq2_pq(res, c("SampleType", "Soil", "Skin"),
    tax_table = GP@tax_table, color_tax = "Class",
    select_taxa = c("522457", "271582")
  )
}


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