cytoglm: Fit GLM with bootstrap resampling

View source: R/cytoglm.R

cytoglmR Documentation

Fit GLM with bootstrap resampling

Description

Fit GLM with bootstrap resampling

Usage

cytoglm(
  df_samples_subset,
  protein_names,
  condition,
  group = "donor",
  covariate_names = NULL,
  cell_n_min = Inf,
  cell_n_subsample = 0,
  num_boot = 100,
  num_cores = 1
)

Arguments

df_samples_subset

Data frame or tibble with proteins counts, cell condition, and group information

protein_names

A vector of column names of protein to use in the analysis

condition

The column name of the condition variable

group

The column name of the group variable

covariate_names

The column names of covariates

cell_n_min

Remove samples that are below this cell counts threshold

cell_n_subsample

Subsample samples to have this maximum cell count

num_boot

Number of bootstrap samples

num_cores

Number of computing cores

Value

A list of class cytoglm containing

tb_coef

coefficent table

df_samples_subset

possibly subsampled df_samples_subset table

protein_names

input protein names

condition

input condition variable

group

input group names

covariate_names

input covariates

cell_n_min

input cell_n_min

cell_n_subsample

input cell_n_subsample

unpaired

true if unpaired samples were provided as input

num_boot

input num_boot

num_cores

input num_cores

formula_str

formula use in the regression model

Examples

set.seed(23)
df <- generate_data()
protein_names <- names(df)[3:12]
df <- dplyr::mutate_at(df, protein_names, function(x) asinh(x/5))
glm_fit <- CytoGLMM::cytoglm(df,
                             protein_names = protein_names,
                             condition = "condition",
                             group = "donor",
                             num_boot = 10) # in practice >=1000
glm_fit

ChristofSeiler/CytoGLMM documentation built on April 21, 2023, 3:38 a.m.