Skip to contents

keju is an R package for statistical analysis of Massively Parallel Reporter Assay (MPRA) data, and outputs transcription rate estimates and differential activity estimates with batch-specific uncertainty quantification.

Installation

R package installation

keju relies on cmdstanr and basilisk. To install cmdstanr, run

install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

# use cmdstanr to install CmdStan, this requires a working C++ toolchain and compiler
library(cmdstanr)
install_cmdstan(cores = 2)

The compiler requirements can be seen at stan-dev. If you run into issues with installation, please ensure your gcc version is > 5. Additionally, if you run into issues with the TBB library, try downgrading CmdStan to version 2.33.1.

keju performs some sparse matrix processing steps that require python. As a result, the R API is a thin wrapper around these python calls, which require python==3.13.3, numpy==2.2.5, pandas==2.2.3, and formulaic==1.1.1. We use basilisk to install a new python environment with these packages. See basilisk, specifically basilisk::configureBasiliskEnv(), for more information and for details about installation location. To install basilisk, run

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("basilisk")

After installing cmdstanr and basilisk, install keju by running

if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

remotes::install_github("pimentellab/keju")
library(keju)

Using keju

An introductory vignette can be found here. If you run into problems, please submit and issue on github or email .

Choosing the correct keju model

keju is not a singular model, but a suite of models for different use cases that fit within each other, a little like Russian nesting dolls. As a result, choosing the correct model for your use case can be confusing.

  • the simplest modeling option is no_motif, and that will get you most of the benefits of using keju. If you’re not sure which model to use, you should probably at least start with no_motif.
  • motif_shrinkage is slightly more specialized version of no_motif. If architectures have some kind of shared structure (i.e., multiple architectures test the same transcription factor binding motif), motif_shrinkage has some statistical niceties that may be of interest and slightly better performance given this motif-level metadata.
  • covariate_motif_slope_intercept is a slightly more specialized version of motif_shrinkage. If you think your covariates are affecting the transcription rate of your architectures (i.e. minimal promoter choice (see our paper)), covariate_motif_slope_intercept can quantify those effects for you given motif-level and covariate-level metadata.

If you have questions, the vignette may be helpful.