marginalisePairwise: Computes marginal likelihoods that two replicate groups...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/marginalisePairwise.R

Description

In cases where multiple models are simultaneously evaluated in the 'getLikelihoods' function, the posterior likelihoods for each model in which one condition is greater than another can be summed to give the marginal likelihood of (directed) difference for all biomolecular events (i.e., data rows).

Usage

1
marginalisePairwise(cD, greaterThan, lessThan)

Arguments

cD

A countData object with evaluated posterior likelihoods in the '@posteriors' slot.

greaterThan

A defined group name (or vector of group names) to identify in the '@groups' slot of the countData object 'cD'; the function will identify all models in which these groups are equivalent and greater than that defined in the 'lessThan' variable.

lessThan

A defined group name (or vector of group names) to identify in the '@groups' slot of the countData object 'cD'; the function will identify all models in which these groups are eqivalent and less than that defined in the 'greaterThan' variable.

Value

A vector of marginal posterior likelihoods defining the probability that the two group identifiers are (directionally) different for each row of the data.

Author(s)

Thomas J. Hardcastle

See Also

allModels marginaliseEqual

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# load test data
data(simData)

# Create a {countData} object from test data, supposing that there are
# multiple experimental groups present.

replicates <- c("simA", "simA", "simB", "simC", "simC", "simD", "simE", "simE", "simF", "simG")
CD <- new("countData", data = simData, replicates = replicates)
CD <- allModels(CD)

# The total number of models generated is high.
length(CD@groups)

# Priors and likelihoods acquired through standard means.

## Not run: CD <- getPriors(CD, cl = cl)
## Not run: CD <- getLikelihoods(CD, cl = cl)

# Marginal likelihood that 'simA' condition is greater than 'simD' group
# for each row of the data.

## Not run: marginalisePairwise(CD, "simA", "simD")

baySeq documentation built on May 2, 2018, 2:28 a.m.