calculateOverlap: Estimate overlap

calculateOverlapR Documentation

Estimate overlap

Description

This function calculates overlap for all sample-pairs in a SummarizedExperiment object.

Usage

calculateOverlap(
  x,
  assay.type = assay_name,
  assay_name = "counts",
  detection = 0,
  ...
)

## S4 method for signature 'SummarizedExperiment'
calculateOverlap(
  x,
  assay.type = assay_name,
  assay_name = "counts",
  detection = 0,
  ...
)

runOverlap(x, ...)

## S4 method for signature 'SummarizedExperiment'
runOverlap(x, name = "overlap", ...)

Arguments

x

a SummarizedExperiment object containing a tree.

assay.type

A single character value for selecting the assay to calculate the overlap.

assay_name

a single character value for specifying which assay to use for calculation. (Please use assay.type instead. At some point assay_name will be disabled.)

detection

A single numeric value for selecting detection threshold for absence/presence of features. Feature that has abundance under threshold in either of samples, will be discarded when evaluating overlap between samples.

...

Optional arguments not used.

name

A single character value specifying the name of overlap matrix that is stored in reducedDim(x).

Details

These function calculates overlap between all the sample-pairs. Overlap reflects similarity between sample-pairs.

When overlap is calculated using relative abundances, the higher the value the higher the similarity is, When using relative abundances, overlap value 1 means that all the abundances of features are equal between two samples, and 0 means that samples have completely different relative abundances.

Value

calculateOverlap returns sample-by-sample distance matrix. runOverlap returns x that includes overlap matrix in its reducedDim.

Author(s)

Leo Lahti and Tuomas Borman. Contact: microbiome.github.io

See Also

calculateJSD calculateUnifrac

Examples

data(esophagus)
tse <- esophagus
tse <- transformAssay(tse, method = "relabundance")
overlap <- calculateOverlap(tse, assay_name = "relabundance")
overlap

# Store result to reducedDim
tse <- runOverlap(tse, assay.type = "relabundance", name = "overlap_between_samples")
head(reducedDims(tse)$overlap_between_samples)


microbiome/mia documentation built on April 27, 2024, 4:04 a.m.