sample_protein_means: Estimate the mean of each protein and condtion using MCMC...

Description Usage Arguments Value Methods (by class)

View source: R/calculate_posterior.R

Description

The method uses MCMC sampling implemented by Stan to find a good approximation to the posterior for each mean. The method is called using the parameters inferred from fit_parameters(). The parameter niter specifies how many samples are drawn for each mean. The number of samples that are available after burnin are samples = niter / 2 * nchains.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sample_protein_means(X, params, niter = 1000, nchains = 4,
  ncores = nchains, batch_size = 1000, verbose = TRUE, ...)

## S4 method for signature 'SummarizedExperiment'
sample_protein_means(X, params,
  niter = 1000, nchains = 4, ncores = nchains, batch_size = 1000,
  verbose = TRUE, ...)

## S4 method for signature 'MSnSet'
sample_protein_means(X, params, niter = 1000,
  nchains = 4, ncores = nchains, batch_size = 1000, verbose = TRUE,
  ...)

Arguments

X

the numerical data where each column is one sample and each row is one protein. Missing values are coded as NA.

params

an object of class 'prodd_parameters'

niter

the number of iteration for each posterior and chain. In the end you will have niter * nchains / 2 samples. Default: 1000

nchains

the number of chains to run in parallel. Default: 4

ncores

the number of cores that are used in parallel. Deafault: nchains.

batch_size

Often it is faster to run the inference for multiple proteins at the same time, but there is a limit after which too many proteins slow down the inference. Set the number of proteins that are considered in a single run. Default: 1000

verbose

boolean indicating how much output the function generates. D Default: 'TRUE'

...

additional parameters for passed to rstan::sampling.

Value

a list with one matrix per condtion. Each matrix has one row per protein and one column per MCMC sample.

Methods (by class)


const-ae/proDD documentation built on Jan. 14, 2020, 9:34 a.m.