getAnansi: anansi wrapper for the MultiAssayExperiment class

getAnansiR Documentation

anansi wrapper for the MultiAssayExperiment class

Description

getAnansi provides a wrapper to execute the anansi pipeline on a MultiAssayExperiment::MultiAssayExperiment() object. It applies the functions weaveWeb() and anansi() in the given order.

Usage

getAnansi(x, ...)

## S4 method for signature 'MultiAssayExperiment'
getAnansi(
  x,
  formula,
  link = NULL,
  tableY = NULL,
  tableX = NULL,
  ...,
  force_new = FALSE
)

Arguments

x

a MultiAssayExperiment::MultiAssayExperiment().

...

additional parameters that can be passed to AnansiWeb() or anansi().

formula

A formula object. Used to assess differential associations.

link

One of the following:

  • Character scalar with value "none"

  • data.frame with two columns

  • list with two such data.frames

tableY, tableX

⁠Character scalar⁠ or ⁠numeric scalar⁠. Selects experiment corresponding to tableY and tableX from experiments(x) of MultiAssayExperiment object by name or index, name is recommended. (Default slots: Y = 1L, X = 2L).

force_new

boolean If x already has a dictionary Matrix in metadata, ignore it and generate a new object anyway? (Default: FALSE).

Details

This wrapper of anansi() allows to perform a complete anansi analysis directly on objects of class MultiAssayExperiment::MultiAssayExperiment(). First, the assays from experiments specified by tableX and tableY are passed to AnansiWeb() to build an AnansiWeb object. If there are more than one assay in that experiment, the specific assay can by specified using assay.type1 and assay.type2. Next, this object is fed to the main anansi() function to compute interactions between the two assays.

Value

If return.format is "table" (default), a wide format data.frame intended to be compatible with ggplot2, or specialized plotting functions (See plotAnansi()). If return.format is "list", a list with aforementioned table, as well as input and additional information. If return.format is "raw", a list of raw output (used for testing purposes).

See Also

AnansiWeb() anansi()

Examples


# Import libraries
library(mia)
library(TreeSummarizedExperiment)
library(MultiAssayExperiment)

web <- randomWeb(n_samples = 100)
mae <- as(web, "MultiAssayExperiment")

# Perform anansi analysis
out <- getAnansi(mae,
    tableY = "y", tableX = "x",
    formula = ~group_ab
)

# View subset of results
head(out, 5)


thomazbastiaanssen/anansi documentation built on June 9, 2025, 3:59 p.m.