Skip to contents

The package implements a Gaussian process (GP) - based regression model to estimate the response surface of the viability responses obtained when two drugs are combined. The input data consists of the measured viability responses and the doses used in the combination experiment. Furthermore, the user can choose between different kernels for the definition of the covariance structure.

The function bayesynergy is the main function of the bayesynergy package. It will fit a Bayesian semi-parametric model for in-vitro drug combination experiments to estimate synergistic and antagonistic effects.

Usage

bayesynergy(
  y,
  x,
  type = 3,
  drug_names = NULL,
  experiment_ID = NULL,
  units = NULL,
  lower_asymptotes = T,
  heteroscedastic = T,
  bayes_factor = F,
  robust = F,
  rho = 0.9,
  pcprior = F,
  pcprior_hypers = c(1, 0.1, 1, 0.2),
  lambda = 0.005,
  nu = 1.5,
  method = "sampling",
  control = list(),
  ...
)

Arguments

y

vector or matrix of viability measures. Replicates can be given in long or wide format.

x

two-column matrix of drug concentrations.

type

integer; the type of model used. Must be one of the following: 1 (Splines), 2 (GP with squared exponential kernel), 3 (GP with Matérn kernel) or 4 (GP with rational quadratic kernel).

drug_names

vector of size 2; names of the drugs utilized for the experiment.

experiment_ID

character; identifier of experiment, typically name of cell Line.

units

vector of size 2; concentration units for the drugs, e.g. c("\(\mu\)M","\(\mu\)M")

lower_asymptotes

logical; if TRUE the model will estimate the lower asymptotes of monotherapy curves.

heteroscedastic

logical; if TRUE, the model will assume heteroscedastic measurement error.

bayes_factor

logical; if TRUE, the Bayes factor is computed between the full model, and a model containing only the non-interaction surface.

robust

logical: if TRUE, the model assumes a log-Pareto-tailed Normal (LPTN) distribution

rho

numeric: the rho hyperparameter for the robust likelihood distribution

pcprior

logical: if TRUE, the model uses a penalized complexity (PC) prior on the kernel hyperparameters of the Matérn kernel (type=3)

pcprior_hypers

vector of size 4 giving hyperparameters for the PC prior on Matérn hyperparameters

lambda

numeric; the parameter controls the residual noise observed in the heteroscedastic model when f = 0.

nu

numeric; the nu parameter for the Matérn kernel. Must be one of (0.5, 1.5, 2.5)

method

The method of estimation. Must be one of `sampling`,`vb` corresponding to full sampling, or variational Bayes.

control

list; passed on to the stan sampler, e.g. for setting adapt_delta.

...

Arguments passed to rstan::sampling or rstan::vb (e.g. iter, chains).

Value

An object of S3 class "bayesynergy", which is a list with the following entries

stanfitAn object of class stanmodel, returned from the sampler.
posterior_meanA list containing the posterior means of model parameters.
dataA list containing the original data used to fit the model.
modelA list containing model specification for the model fit.
returnCodenumeric; non-zero values indicate model was fit with errors or warnings
LPMLnumeric; The log pseudo-marginal likelihood of the fitted model.
divergentnumeric; The number of divergent transitions from the Hamiltonian sampler.
messagescharacter; any warnings are collected here for inspection.
bayesfactornumeric; The Bayes factor comparing the full model to a simpler model containing only the non-interaction assumption, p0. A large number indicating that an interaction effect is present. See the package vignette for more information.

Author

Maintainer: Leiv Rønneberg leiv.ronneberg@mrc-bsu.cam.ac.uk

Authors:

Examples

if (FALSE) { # \dontrun{
library(bayesynergy)
data("mathews_DLBCL")
y_mat <- mathews_DLBCL$`ispinesib + ibrutinib`[[1]]
x_mat <- mathews_DLBCL$`ispinesib + ibrutinib`[[2]]
fit <- bayesynergy(y_mat,x_mat)
} # }