Fit GLMM with method of moments

cytoglmm(
  df_samples_subset,
  protein_names,
  condition,
  group = "donor",
  covariate_names = NULL,
  cell_n_min = Inf,
  cell_n_subsample = 0,
  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_cores

Number of computing cores

Value

A list of class cytoglm containing

glmmfit

mbest object

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

num_cores

input num_cores

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))
glmm_fit <- CytoGLMM::cytoglmm(df,
                               protein_names = protein_names,
                               condition = "condition",
                               group = "donor")
#> Warning: moment-based covariance matrix estimate is not positive semi-definite; using projection
glmm_fit
#> number of cells per group and condition:   
#>     control treatment
#>   1    1000      1000
#>   2    1000      1000
#>   3    1000      1000
#>   4    1000      1000
#>   5    1000      1000
#>   6    1000      1000
#>   7    1000      1000
#>   8    1000      1000
#> 
#> proteins included in the analysis:
#>  m01 m02 m03 m04 m05 m06 m07 m08 m09 m10 
#> 
#> condition compared: condition 
#> grouping variable: donor