get_rate_summary: Rates summary

View source: R/rate_plot.R

get_rate_summaryR Documentation

Rates summary

Description

Summarize OCR and ECAR as mean and bounded standard deviations or standard error with confidence intervals

Usage

get_rate_summary(
  seahorse_rates,
  measure = "OCR",
  assay,
  model = "ols",
  error_metric = "ci",
  conf_int = 0.95,
  sep_reps = FALSE,
  ci_method = "Wald"
)

Arguments

seahorse_rates

data.table Seahorse OCR and ECAR rates (imported using read_data function)

measure

Whether to calculate summary for "OCR" or "ECAR"

assay

What assay to calculate summary for (e.g. "MITO" or "GLYCO")

model

The model used to estimate mean and confidence intervals:

error_metric

Whether to calculate error as standard deviations ("sd") or confidence intervals ("ci")

conf_int

The confidence interval percentage. Should be between 0 and 1

sep_reps

Whether to calculate summary statistics on the groups with replicates combined. The current default FALSE combines replicates, but future releases will default to TRUE providing replicate-specific summaries.

ci_method

The method used to compute confidence intervals for the mixed-effects model: "Wald", "profile", or "boot" passed to lme4::confint.merMod().

Value

a data.table with means, standard deviations/standard error with bounds around the mean(sd or confidence intervals)

Examples

rep_list <- system.file("extdata", package = "ceas") |>
  list.files(pattern = "*.xlsx", full.names = TRUE)
seahorse_rates <- read_data(rep_list, sheet = 2)
combined_reps <- get_rate_summary(
  seahorse_rates,
  measure = "OCR",
  assay = "MITO",
  model = "ols",
  error_metric = "ci",
  conf_int = 0.95,
  sep_reps = FALSE
)
head(combined_reps, n = 10)

# separate replicates
sep_reps <- get_rate_summary(
  seahorse_rates,
  measure = "OCR",
  assay = "MITO",
  model = "ols",
  error_metric = "ci",
  conf_int = 0.95,
  sep_reps = TRUE
)
head(sep_reps, n = 10)

# mixed effects model
reps_as_random_effects <- get_rate_summary(
  seahorse_rates,
  measure = "OCR",
  assay = "MITO",
  model = "mixed",
  error_metric = "ci",
  conf_int = 0.95,
  sep_reps = FALSE
)
head(reps_as_random_effects, n = 10)

ceas documentation built on April 3, 2025, 8:34 p.m.