pepBayesMcmc-methods: MCMC sampling for pepBayes models.

Description Usage Arguments Details Value See Also

Description

Sample the posterior distribution of pepBayes models. The generic function has methods for peptideSet objects and for pepBayesFit objects for restarting a Markov chain from its last position.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pepBayesMcmc(x, ...)

## S4 method for signature 'peptideSet'
pepBayesMcmc(x, position_data = NULL,
  control_id = NULL, n_samples, n_thin, n_burn, n_threads = detectCores(),
  prior_control_list = NULL, chain_control_list = NULL)

## S4 method for signature 'pepBayesFit'
pepBayesMcmc(x, n_samples, n_thin, n_burn = 0,
  n_threads = detectCores(), join_output = TRUE)

Arguments

x

A pepBayesFit or peptideSet object containing experiment data.

...

Additional arguments for sampling control. See methods.

position_data

A data.frame or GRanges object with peptide position information.

control_id

Character, indicating which slides are control slides from the "visit" column of the phenoData slot of the peptideSet argument.

n_samples

Number of MCMC posterior samples to collect.

n_thin

Number of MCMC iterations between posterior samples.

n_burn

Number of MCMC iterations to perform before sampling begins.

n_threads

Number of parallel threads to use during sampling.

prior_control_list

A named list of parameter values to initialize

chain_control_list

A named list of parameters controlling which parameters to update or fix.

join_output

A boolean. Should input be merged with output?

Details

PepBayes estimates the posterior probability of a differential antibody response against each peptide in a peptide microarray assay, for each subject, when compared with control samples. Two common experimental designs are automatically detected. In an unpaired design, differences between a population of interest and a control population are detected. A paired design has matched samples for each subject before and after a treatment is applied. The function pepBayesMcmc automatically detects the experimental design from the data, and runs MCMC to sample the posterior distribution of the appropriate pepBayes model.

When x is a peptideSet object, the paired or unpaired model is chosen depending on the 'ptid' column of pData(x). Paired data is detected when each unique value of 'ptid' appears exactly twice among all slides.

The position_data argument supplies information about peptide position information. This argument may be a 'data.frame' with columns 'start', 'end' or 'width', and 'peptide'. If a 'GRanges' object, then it must have either peptide as a name or have peptide as a metadata column. If omitted (position_data = NULL), response probability hyperparamters will be fixed during estimation.

When x is a pepBayesFit object, the chain is started from the most recent parameter values in the fitted object. In the event that x is the output of a previous MCMC fit, the argument join_output becomes relevant. If TRUE, parameter traces are appended to those in x and the posterior probabilities of binding are averaged together based on the number of iterations in the fitted object and the current chain.

Value

An object of type pepBayesFit containing sorted slide metadata, Markov chain posterior samples, posterior probabilities of binding, and chain information.

See Also

pepBayesFit pepBayesFit-methods peptideSet pepBayesEcm pepBayesCalls


RGLab/pepBayes documentation built on May 8, 2019, 5:55 a.m.