R/poisson_lognormal_mcle.R
poisson_lognormal_mcle.Rd
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"
)
Data frame or tibble with proteins counts, cell condition, and group information
A vector of column names of protein to use in the analysis
The column name of the condition variable
The column name of the group variable
Number of CPU cores
Path to slurm cluster template for batchtools
A list of class cytoeffect_poisson_mcle
containing
output tibble of model fits
input protein names
input condition variable
input group names
input df_samples_subset table
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' ...