These functions are used to implement the ReX model from Crook et al 2024. using HDX-MS data using RJ-MCMC for inference.

These functions are used to implement the ReX model from Crook et al 2024. using HDX-MS data using RJ-MCMC for inference.

rex(
  HdxData,
  numIter = 1000,
  R = 379,
  numtimepoints = 3,
  multivariate = FALSE,
  timepoints = c(0, 30, 300),
  tCoef = 1,
  density = "Gaussian",
  R_lower = 1,
  R_upper = R,
  priors = list(lambda = 100/(R - 1), meanlog = -3, sdlog = 1, rho = 0.5, shape1 = 1,
    shape2 = 5, shape = 1, b_alpha = 1, b_beta = 200, dshape = 1, d_alpha = 1, d_beta =
    1, sigma_sd = 0.5, pishape1 = 1, pishape2 = 10),
  phi = 0.92,
  init_param = "d",
  numChains = 2L,
  seed = NULL,
  BPPARAM = BiocParallel::bpparam()
)

resolver(
  res,
  numIter = 1000,
  R = 379,
  numtimepoints = 3,
  multivariate = FALSE,
  timepoints = c(0, 30, 300),
  tCoef = 1,
  density = "Gaussian",
  R_lower = 1,
  R_upper = R,
  priors = list(lambda = 100/(R - 1), meanlog = -3, sdlog = 1, rho = 0.5, shape1 = 1,
    shape2 = 5, shape = 1, b_alpha = 1, b_beta = 200, dshape = 1, d_alpha = 1, d_beta =
    1, sigma_sd = 0.5, pishape1 = 1, pishape2 = 10),
  phi = 0.92,
  init_param = "d",
  seed = NULL
)

Arguments

HdxData

An object of class DataFrame containing the HDX-MS data

numIter

The number of iterations for the MCMC. Default is 1000 but recommend at least 5000 in practice

R

The number of residues in the protein

numtimepoints

The number of timepoints in the HDX-MS experiment

multivariate

A logical indicating whether to use a multivariate model. Default is FALSE.

timepoints

A numeric vector of timepoints in the HDX-MS experiment. Default is c(0, 30, 300).

tCoef

A numeric value for the timpeoint standard deviation coefficient. Default is 1. This allows for the timepoint standard deviation to vary by a fixed factor. 1 indicates the same for each timepoint.

density

A character string indicating the density function to use. Default is "Gaussian" but typically "laplace" is also used.

R_lower

A numeric value indicating the lower bound for the residue number. Default is 1. This may change if you want to subset the protien or avoid a his-tag.

R_upper

A numeric value indicating the upper bound for the residue number. Default is R. This may change if you want to subset the protien.

priors

A list of prior parameters for the model

phi

A numeric value indicating the maximum uptake possible. Default is 0.92. Typically the deuterium buffer concentration of the HDX-MS experiment.

init_param

A character string indicating the initial parameter to use. Default is "d" but "b" is also possible. This is used to help find good initial parameters by guessing the initial uptake and is used in the uptakeGuess function. We do not recommend changing this unless you are an expert.

numChains

A numeric value indicating the number of chains to run. Default is 2. This is used to run the chains in parallel.

seed

An integer value indicating the random number generation seed. Default is NULL. This is used to set the seed for reproducibility.

BPPARAM

A BiocParallelParam object indicating the parallel backend to use. Default is BiocParallel::bpparam(). This is used to run the chains in parallel.

res

An object of class DataFrame containing the HDX-MS data

Value

Rex returns an object of class RexParams containing the results

Rex returns an object of class RexParams containing the results

Details

The 'ReX' function generates the sample from the joint posterior distribution (object or class 'Rexparams') based on annotated HDX-MS data (object of class DataFrame). Both are then passed to the RexProcess function to generate summary data for further analysis and visualisation

The 'ReX' function generates the sample from the joint posterior distribution (object or class 'Rexparams') based on annotated HDX-MS data (object of class DataFrame). Both are then passed to the RexProcess function to generate summary data for further analysis and visualisation

Examples

require(RexMS)
require(dplyr)
data("BRD4_apo")
BRD4_apo <- BRD4_apo %>% filter(End < 40)

numTimepoints <- length(unique(BRD4_apo$Exposure))
Timepoints <- unique(BRD4_apo$Exposure)

rex_example <- rex(HdxData = DataFrame(BRD4_apo),
                numIter = 4, # typically much larger
                R = max(BRD4_apo$End),
                numtimepoints = numTimepoints,
                timepoints = Timepoints,
                seed = 1L,
                numChains = 1L,
                tCoef = c(0, rep(1, 5)),
                BPPARAM = SerialParam())
#> Fold 1 ... Fold 2 ... Fold 3 ... Fold 4 ... Fold 5 ... 
#> 
  |                                                                            
  |                                                                      |   0%