interventionalInferenceAdvanced: Dynamic Bayesian Network inference with interventions.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/interventionalInferenceAdvanced.R

Description

This function performs exact Bayesian inference for dynamic Bayesian networks using microarray timecourse data. Several intervention models can be chosen to take into account the effect of inhibitors.

Usage

1
2
3
4
5
interventionalInferenceAdvanced(y, X0, X1, cond, inhibition, inhibitors, max.indeg,
  g = NULL, Sigma = NULL, inferParents = NULL, allowSelfEdges = TRUE,
  perfect = FALSE, fixedEffect = FALSE, mechanismChange = FALSE,
  priorType = "uninformed", priorGraph = NULL, priorStrength = 3,
  fittedValues = FALSE)

Arguments

y

an n by P matrix filled with the response values, where n is the number of observations and P is the number of nodes.

X0

an n by a matrix - the part of the design matrix that is the same for all models. a is the number of parameters that are in all of the modesl.

X1

an n by P matrix - the part of the design matrix to undergo model selection. colnames(X1) provides the labels for the output.

cond

an n by 1 matrix giving the experimental condition number of each sample. Filled with integers from 1 to the number of different conditions.

inhibition

a conditions by inhibitors binary matrix, where element (c,i) is one iff inhibitor i is active in condition c.

inhibitors

an inhibitors by P binary matrix, where element (i,p) is one iff inhibitor i affects node p.

max.indeg

The maximum permitted in-degree for each node.

g

The constant g in Zellner's g-prior. Defaults to n.

Sigma

an n by n covariance matrix of the responses, divided by σ^2. Faster if not specified, in which case the identity matrix is assumed.

inferParents

a vector of node indices specifying which nodes to infer parents for. If omitted, parents are inferred for all nodes.

allowSelfEdges

Should self-edges be allowed?

perfect

Apply perfect-out interventions?

fixedEffect

Apply fixed-effect-out interventions?

mechanismChange

Apply mechanism-change-out interventions? Note: cannot be applied with perfect interventions.

priorType

One of "uninformed", "Mukherjee" and "Hamming". In the structural Hamming distance prior, each difference from the edges in priorGraph incurs a prior penalty of exp(-priorStrength). In the Mukherjee-Speed prior, adding edges from outside priorGraph earns the same penalty as before, but if a prior edge is omitted a penalty is no longer incurred.

priorGraph

A P by P binary matrix specifying the prior graph. If (i,j)=1 then node i influences node j. If omitted, an uninformed prior is used.

priorStrength

The prior strength parameter. Ignored (but don't set it to NA) if priorGraph is NULL. If specified as a vector then the value from that gives the highest marginal likelihood is chosen (Empirical Bayes).

fittedValues

Perform a second pass to calculate the fitted values?

Details

The function interventionalInference provides a simpler, but less general way of coding which inhibitors are active in each condition. Currently this advanced version only supports -out forms of the interventions. By default the fixed effects in the fixedEffect intervention are assumed to be additive in samples with multiple inhibitors. However if you do not wish for this to be the case, then you can simply define a dummy inhibitor for each combination of inhibitors and a new fixed effect parameter will be estimated. See example 7 below.

Value

pep

A P by P matrix of posterior probabilities, where element (i,j) gives the posterior probability that node i influences node j.

MAP

A P by P binary matrix giving the maximum a posteriori network.

parentSets

A countGraphs(P,max.indeg) by P binary matrix, where element (m,p=1) iff node i is a parent in model m.

ll

A countGraphs(P,max.indeg) by P matrix, where element (m,p) gives the log-likelihood for model m for node p.

lpost

A countGraphs(P,max.indeg) by P matrix, where element (m,p) gives the log-posterior probability for model m for node p.

MAPprob

A P vector where element p gives the posterior probability of the maximum a posteriori model for node p.

MAPmodel

A P vector where element p gives the index of the maximum a posterior model for node p (between 1 and countGraphs(P,max.indeg).

marginal.likelihood

A P by length(priorStrength) matrix that gives the marginal likelihood for each node.

ebPriorStrength

Value of priorStrength with the largest marginal likelihood, if priorStrength is a vector; NULL otherwise.

yhat

The posterior expected fitted values, if fittedValues is TRUE.

inputs

A list containing the inputs to interventionalInferenceAdvanced

Author(s)

Simon Spencer

References

Spencer, S.E.F, Hill, S.M. and Mukherjee, S. (2012) Dynamic Bayesian networks for interventional data. CRiSM pre-print 12-24.
Mukherjee, S. and Speed, T.P. Network inference using informative priors. Proc. Nat. Acad. Sci. USA, 105, 14313-14318.

See Also

interventionalDBN-package, interventionalInference, formatData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
library(interventionalDBN)
data(interventionalData)# loads interventionalData.
# Load your own data spreadsheet using myData<-read.csv("myDataFile.csv").

# Format the data for network inference
d<-formatData(interventionalData)

# Perform network inference without modelling interventions.
myNetwork0<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,max.indeg=3,fittedValues=TRUE)

# EGFRi is active in conditions 2 and 4, AKTi is active in conditions 3 and 4.
myInhibition<-cbind(c(0,1,0,1),c(0,0,1,1))
myInhibitors<-matrix(0,2,15)
myInhibitors[1,1]<-1 # EGFRi targets EGFR (node 1).
myInhibitors[2,8]<-1 # AKTi targets AKT (node 8).

# Perform network inference with perfect and fixed effect interventions.
myNetwork1<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,d$cond,max.indeg=3,
  inhibition=myInhibition,inhibitors=myInhibitors,perfect=TRUE,fixedEffect=TRUE)

# Perform network inference on with mechanism change interventions.
myNetwork2<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,d$cond,max.indeg=3,
  inhibition=myInhibition,inhibitors=myInhibitors,mechanismChange=TRUE)

# Perform network inference with Mukherjee Prior that prefers to omit self-edges.
myNetwork3<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,d$cond,max.indeg=3,
  inhibition=myInhibition,inhibitors=myInhibitors,perfect=TRUE,fixedEffect=TRUE,
  priorType="Mukherjee",priorGraph=matrix(1,15,15)-diag(rep(1,15)),priorStrength=2)
# Compare with self-edge peps with myNetwork1
diag(myNetwork1$pep)-diag(myNetwork3$pep)

# Perform network inference with Hamming Prior that prefers self-edges,
# and use Empirical Bayes to choose the priorStrength.
myNetwork4<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,d$cond,max.indeg=3,
  inhibition=myInhibition,inhibitors=myInhibitors,perfect=TRUE,fixedEffect=TRUE,
  priorType="Hamming",priorGraph=diag(rep(1,15)),priorStrength=0:10/2)
# You should always check to see if the Empirical Bayes appears to be working.
plotMaxML(myNetwork4)

# Now let's try using using the gradients as the response.
# Note that we have to tranfser Sigma this time, as it is no longer the identity.
d<-formatData(interventionalData,gradients=TRUE,initialIntercept=FALSE)

# Perform network inference on gradients with perfect-out interventions.
myNetwork5<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,d$cond,max.indeg=3,
  Sigma=d$Sigma,inhibition=myInhibition,inhibitors=myInhibitors,perfect=TRUE)

# So far we have assumed that the fixed effects are additive in EGFRi+AKTi.
# Now let's change this, by coding EGFRi+AKTi as a separate inhibitor.
d<-formatData(interventionalData)
# EGFRi+AKTi is active in condition 4.
myInhibition<-cbind(c(0,1,0,0),c(0,0,1,0),c(0,0,0,1))
myInhibitors<-matrix(0,3,15)
myInhibitors[1,1]<-1 # EGFRi targets EGFR (node 1).
myInhibitors[2,8]<-1 # AKTi targets AKT (node 8).
myInhibitors[3,c(1,8)]<-1 # EGFRi+AKTi targets both.

# Perform network inference on gradients with fixed effect interventions.
myNetwork7<-interventionalInferenceAdvanced(d$y,d$X0,d$X1,d$cond,max.indeg=3,
  inhibition=myInhibition,inhibitors=myInhibitors,fixedEffect=TRUE)

interventionalDBN documentation built on May 30, 2017, 8:24 a.m.