Description Usage Arguments Details Value Note Examples
View source: R/fitting_functions.R
This function fits a Bayesian model of survival/dropout CRISPR screen data. It uses a negative binomial to model the input and output counts of gRNAs, adjusting the results appropriately to account for sequencing depth.
1 2 3 4 5 6 7 8 9 10 11 | fit_dropout_model(
dropout_data,
out_dir = NULL,
n_cores = 1,
tot_samp = 10000,
n_warmup = 500,
n_chains = 4,
rep_cutoff = 0.1,
plot_rep_cutoff = TRUE,
verbose = TRUE
)
|
dropout_data |
a data frame of dropout data. See details for column requirements. |
out_dir |
path to output directory |
n_cores |
number of cores to utilize |
tot_samp |
total number of MCMC draws to take, spread evenly across chains |
n_warmup |
total number of warmup draws to take from each MCMC chain |
n_chains |
number of MCMC chains to run in each sampler |
rep_cutoff |
a representation cutoff quantile (0 to 1) |
plot_rep_cutoff |
logical indicating whether to plot the representation cutoff histogram |
verbose |
logical indicating whether to print messages |
dropout_data
requires the following columns:
gene_id - character column giving a unique identifier for each gene
gRNA - character column giving identifiers for individual gRNAs (usually the gRNA sequence itself)
input count columns - columns of sequencing counts of the input gRNA library. Multiple columns for sequencing replicates are allowed (which require unique identifiers). Column names must contain the string "input".
output count columns - columns of sequencing counts of gRNAs in the output libraries. Multiple columns allowed (which in turn require unique names). Column name must contain the string "output".
a data frame of input counts, fit and model statistics for the log-fold-change for each input gene.
Currently this function only supports marginal priors. If you want to use grouped/conditional priors, contact the malacoda developers.
The gene_data
column in the output contains only the gRNAs that
passed the representation cutoff.
1 2 3 4 5 6 | # This example uses too-few MCMC samples for the sake of run time. Convergence will be poor.
fit_dropout_model(dropout_data = dropout_example,
n_cores = 1,
tot_samp = 20,
n_warmup = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.