poisson_lognormal uses maximum composite likelihood estimation to fit Poisson log-normal models to each sample.

poisson_lognormal_mcle(
  df_samples_subset,
  protein_names,
  condition,
  group,
  ncores = 1,
  slurm_settings = "slurm_batchtools.tmpl"
)

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

ncores

Number of CPU cores

slurm_settings

Path to slurm cluster template for batchtools

Value

A list of class cytoeffect_poisson_mcle containing

tb_args

output tibble of model fits

protein_names

input protein names

condition

input condition variable

group

input group names

df_samples_subset

input df_samples_subset table

Examples

set.seed(1)
df = simulate_data(n_cells = 10)
str(df)
#> tibble [80 × 7] (S3: tbl_df/tbl/data.frame)
#>  $ donor    : chr [1:80] "pid01" "pid01" "pid01" "pid01" ...
#>  $ condition: Factor w/ 2 levels "control","treatment": 2 2 2 2 2 2 2 2 2 2 ...
#>  $ m01      : num [1:80] 80 6 6 3 17 20 14 90 79 46 ...
#>  $ m02      : num [1:80] 21 3 4 1 1 9 40 17 24 0 ...
#>  $ m03      : num [1:80] 6 2 12 49 3 8 14 6 0 4 ...
#>  $ m04      : num [1:80] 4 0 11 10 0 2 22 8 14 13 ...
#>  $ m05      : num [1:80] 12 0 3 0 0 1 1 4 1 1 ...
fit = poisson_lognormal_mcle(df,
                             protein_names = names(df)[3:ncol(df)],
                             condition = "condition",
                             group = "donor",
                             ncores = 1)
#> No readable configuration file found
#> Created registry in '/Users/cseiler/Documents/GitHub/cytoeffect/docs/reference/registry_2022_12_12_104154' using cluster functions 'Interactive'
#> Adding 8 jobs ...
#> Submitting 8 jobs in 8 chunks using cluster functions 'Multicore' ...
#> This deletes all files in '/Users/cseiler/Documents/GitHub/cytoeffect/docs/reference/registry_2022_12_12_104154'. Proceeding in 5 seconds ...
#> Unsetting registry as default
#> Recursively removing files in '/Users/cseiler/Documents/GitHub/cytoeffect/docs/reference/registry_2022_12_12_104154' ...