absorb-methods: Absorb evidence and propagate beliefs in a genotype-phenotype...

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

Description

Absorb a single piece or a spectrum of evidence for one or more phenotype nodes, propagate the beliefs, obtain the updated beliefs and quantify the effects.

Usage

1
2
3
4
5
## For Conditional Gaussian Bayesian Networks
## and Discrete Bayesian Networks (Implements RHugin)
absorb.gnbp(object, node, evidence)
## For Discrete Bayesian Networks (Implements gRain)
absorb.dbn(object, node, evidence)

Arguments

object

an object of class "gpfit" (output from fit.gnbp) for absorb.gnbp or an object of class "dbnfit" (Output from fit.dbn) for absorb.dbn.

node

a character vector specifying the names of the nodes for which the evidence is to be absorbed.

evidence

a matrix or a numeric vector of evidence. number of rows of the matrix or the length of the vector should be equal to the length of node.

Details

The function absorb.gnbp is compatible with the output produced by fit.gnbp. It absorbs evidence in both conditional gaussian bayesian networks or discrete bayesian networks inferred by RHugin and propagates beliefs by the PC algorithm implemented in the RHugin package. Jeffrey's Signed information is calculated to quantify the effects of the evidence absorption on the marginals. Note that the demo version of HuginLite is restricted to 50 states and 500 cases.

The function absorb.dbn is compatible with the output produced by fit.dbn. It absorbs evidence in only discrete bayesian networks that are inferred by bnlearn. Belief propagation is implemented using gRain package.

Value

absorb.gnbp returns an object of class "gnbp" while absorb.dbn returns an object of class "dbn". An object of class "gnbp" or "dbn" is a list containing the following components.

gp

an RHugin domain (for absorb.gnbp) or a grain object (for absorb.dbn) that is triangulated, compiled and with the latest absorbed evidence propagated.

gp_flag

type of network.

node

a character vector specifying the nodes for which evidence has been absorbed

marginal

a list of marginal probabilities for phenotypes (pheno) and genotypes (geno)

belief

a list of updated beliefs for phenotypes (pheno) and genotypes (geno)

JSI

a matrix of Jeffrey's signed information if network is Conditional Gaussian, otherwise NULL if network is Discrete Bayesian.

FC

a list of two. a matrix FC of fold changes and a matrix pheno_state of phenotype node beliefs - state with maxium probability. If network is Conditional Gaussian, a NULL value is returned.

The marginals, beliefs and JSI or FC are calculated for only d-connected nodes.

If a sequence of evidence is absorbed for a single node in a Conditional Gaussian network, a plot of JSI vs evidence is produced.

Author(s)

Janhavi Moharil <janhavim@buffalo.edu>

See Also

gen.evidence, plot.gnbp, plot.dbn

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
## load the mouse kidney eQTL dataset
data(mouse)

## get genotype and phenotype data
mousegeno<-mouse[,1:5]
mousepheno<-mouse[,6:19]

## Not run: 
## Simple example : Fit a bayesian network to genotype-phenotype data 
mouse.cgbn<-fit.gnbp(mousegeno,mousepheno,alpha=0.1)

## Absorb a single evidence for a single node
absorb.gnbp(mouse.cgbn,node="Tlr12",evidence=matrix(2.5))

## Absorb a sequence of evidence for a single node generated using \code{\link{gen.evidence}
mouse.cgbn<-fit.gnbp(mousegeno,mousepheno,alpha=0.1)
evidence<-gen.evidence(mouse.cgbn,node="Tlr12")
absorb.gnbp(mouse.cgbn,node="Tlr12",evidence=evidence)

##Absorb sequence of evidence for multiple nodes}
mouse.cgbn<-fit.gnbp(mousegeno,mousepheno,alpha=0.1)
evidence<-gen.evidence(mouse.cgbn,node=c("Ak2","Ptp4a2","Hmgcl"),std=2,std.equal=TRUE)
absorb.gnbp(mouse.cgbn,node=rownames(evidence),evidence=evidence)

## End(Not run)

geneNetBP documentation built on May 2, 2019, 5:19 p.m.