makeDisMat: Create a biweight midcorrelation (WGCNA::bicor()) based...

View source: R/makeDisMat.R

makeDisMatR Documentation

Create a biweight midcorrelation (WGCNA::bicor()) based distance matrix.

Description

Create a biweight midcorrelation (WGCNA::bicor()) based distance matrix.

Usage

makeDisMat(
  se,
  metadata_variable = 1,
  min_prevalence = 0.7,
  execution_mode = "serial",
  optimize.for = c("runtime", "memory")
)

Arguments

se

SummarizedExperiment object created using Macarron::prepInput().

metadata_variable

metadata column identifying phenotypes/conditions to be used to evaluate prevalence of features. Default = Column 1 of metadata dataframe.

min_prevalence

prevalence threshold (percentage). Default = 0.7.

execution_mode

"serial" or "multi" processing with BiocParallel. Default: "serial" (recommended for laptops). "multi" may be used when running Macarron on a cluster.

optimize.for

runtime or memory.

Features present (i.e. not NA) in "min_prevalence" of samples in each category of a "metadata_variable" will be considered e.g. if min_prevalence is 0.7 and metadata_variable has 2 categories A and B, union of (i) features present in at least 70 and (ii) features present in at least 70 Correlation between feature abundances are is calculated using WGCNA::bicor().

Value

w distance matrix where distance = 1-bicor^3

Examples

prism_abundances = system.file("extdata", "demo_abundances.csv", package="Macarron")
abundances_df = read.csv(file = prism_abundances, row.names = 1)
prism_annotations = system.file("extdata", "demo_annotations.csv", package="Macarron")
annotations_df = read.csv(file = prism_annotations, row.names = 1)
prism_metadata = system.file("extdata", "demo_metadata.csv", package="Macarron")
metadata_df = read.csv(file = prism_metadata, row.names = 1)
mbx <- Macarron::prepInput(input_abundances = abundances_df,
                            input_annotations = annotations_df,
                            input_metadata = metadata_df)
w <- Macarron::makeDisMat(se = mbx)



biobakery/Macarron documentation built on June 29, 2024, 7:58 a.m.