autoplot.interaction_table: autoplot.interaction_table

View source: R/significance_pipeline.R

autoplot.interaction_tableR Documentation

autoplot.interaction_table

Description

Makes a diagnostic plot of an interaction_table

Usage

## S3 method for class 'interaction_table'
autoplot(
  object,
  OTU_stat,
  type = "num_int",
  cutoff_type = "q",
  abundance_type = "mean",
  ...
)

Arguments

object

An interaction_table

OTU_stat

OTU statistics obtained from the function OTU_stats

type

One of the following:

  • 'num_int' Plots the number of interactions for each OTU against its abundance

  • 'ab_prod' Plots the product of the abundances of each significant pairs of OTUs against the q- or p-value of the interaction

  • 'sim_cor' Plots the absolute value of sim.score of each significant interactions against the q- or p-value of the interaction

cutoff_type

One of the following:

  • 'q' Plots according to the q-values

  • 'p' Plots according to the p-values

This parameter is ignored if type='num_int'

abundance_type

The type of abundance to use in the plots. One of c('mean','median','max').

...

Currently ignored

Details

Note that if type='sim_cor', a column named sign, indicating the sign of the interaction, is available even though the plotting function does not use this feature.

Value

A ggplot object showing the desired diagnostic plot

Examples

library(micInt)
data("seawater")
sim.scores <- similarity_measures(subset= c("spearman","pearson"))
res <- runAnalysis(OTU_table = seawater,sim.scores = sim.scores,
returnVariables = 'ccrepe_res',iterations = 100,parallel = FALSE)
int_table <- create_interaction_table(res$ccrepe_res$spearman$res)
stats <- OTU_stats(seawater)
autoplot(int_table,stats,type = "ab_prod",cutoff_type = "p",abundance_type = "max")

AlmaasLab/micInt documentation built on April 1, 2022, 10:37 a.m.