Function to obtain uncertainty estimates for the total relative error (TRE)

processTREuncertainty(
  HdxData,
  params,
  whichChain = 1,
  whichSamples = seq.int(50),
  num_montecarlo = 5000
)

Arguments

HdxData

A data frame containing the HDX-MS data for which you want to perform the differential analysis. Typically this dataframe contains the apo data.

params

An object of class RexParams containing a fitted ReX model typically to the differential of interest (e.g. ligand binding)

whichChain

A numeric value indicating the chain to use. Default is 1.

whichSamples

A numeric vector indicating which samples to use. Default is seq.int(50).

num_montecarlo

A numeric value indicating the number of montecarlo samples to use for the error analysis. Default is 5000.

Value

An array of the total relative error (TRE) for each residue at each timepoint represnting uncertainty in the distribution

Examples

require(RexMS)
require(dplyr)
data(BRD4_apo)
data(BRD4_ibet)
BRD4_apo <- BRD4_apo %>% filter(End < 100)
BRD4_ibet <- BRD4_ibet %>% filter(End < 100)
numTimepoints <- length(unique(BRD4_apo$Exposure))
Timepoints <- unique(BRD4_apo$Exposure)
numPeptides <- length(unique(BRD4_apo$Sequence))

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

rex_example <- RexProcess(HdxData = DataFrame(BRD4_ibet),
                        params = rex_example,
                        range = 50:100,
                        thin = 1,
                        whichChains = c(1,2))

rex_TRE_uncertainty <- processTREuncertainty(HdxData = DataFrame(BRD4_apo),
                                           params = rex_example,
                                           whichChain = 1,
                                           num_montecarlo = 5000)