Dysbiosis scores measure how much the community of a sample differs from the communities of control samples.

addDysbiosis(x, ...)

getDysbiosis(x, ...)

# S4 method for class 'SummarizedExperiment'
addDysbiosis(x, ...)

# S4 method for class 'SummarizedExperiment'
getDysbiosis(
  x,
  col.var,
  assay.type = "counts",
  index = "median_distance",
  name = index,
  method = "bray",
  ...
)

Arguments

x

a SummarizedExperiment object.

...

Additional arguments. The following optional arguments are supported:

  • reference: NULL or Character scalar. Specifies the group in col.var that is used as controls. If NULL, the first level of factor(x[[col.var]]) is used. (Default: NULL)

    \item \code{group}: \code{NULL} or \code{Character scalar}. Specifies a
    variable from \code{colData(x)} (e.g., subject ID). Control samples that
    share the same value with the current sample are excluded from its
    comparison. (Default: \code{NULL})
    
    \item \code{altexp}: \code{NULL} or \code{Character scalar}. If provided,
    use this \code{altExp} assay container of \code{x} for the computation.
    (Default: \code{NULL})
    
    \item Further arguments are passed to
    \code{\link[=getDissimilarity]{getDissimilarity}}.

col.var

Character scalar. Specifies a variable from colData(x) that defines the groups.

assay.type

Character scalar. Specifies the name of assay used in calculation. (Default: "counts")

index

Character vector. Specifies the dysbiosis scores to calculate. (Default: "median_distance")

name

Character vector. Specifies the column names for the scores in colData(x). (Default: index)

method

Character scalar. Specifies the dissimilarity measure passed to getDissimilarity. (Default: "bray")

Value

getDysbiosis returns a DataFrame with one row per sample. addDysbiosis returns x with the scores added to colData(x).

Details

The following scores are available:

  • median_distance: Median dissimilarity between the sample and the control samples. The sample itself is excluded from the controls. With Bray-Curtis dissimilarity, this is the dysbiosis score of Lloyd-Price et al. (2019).

References

Lloyd-Price J, et al. (2019) Multi-omics of the gut microbial ecosystem in inflammatory bowel diseases. Nature 569, 655-662.

Examples

data(Tengeler2020)
tse <- Tengeler2020

tse <- addDysbiosis(tse, col.var = "patient_status", reference = "Control")
colData(tse)[, c("patient_status", "median_distance")]
#> DataFrame with 27 rows and 2 columns
#>      patient_status median_distance
#>         <character>       <numeric>
#> A110           ADHD        0.724328
#> A12            ADHD        0.728935
#> A15            ADHD        0.787618
#> A19            ADHD        0.719223
#> A21            ADHD        0.762736
#> ...             ...             ...
#> A26         Control        0.698069
#> A27         Control        0.622675
#> A33         Control        0.617174
#> A35         Control        0.782491
#> A38         Control        0.617638