Learn R Programming

geneNetBP (version 1.0.0)

fit.gnbp: Fit a Conditional Gaussian Bayesian Network to QTL data

Description

Learn the structure of a genotype-phenotype network from quantitative trait loci (QTL) data and the conditional probability table for each node in the network using the PC algorithm and the EM algorithm implemented in the RHugin package.

Usage

fit.gnbp(geno,pheno,constraints,learn="TRUE",edgelist,type ="cg",
                  alpha=0.001,tol=1e-04,maxit=0)

Arguments

geno
a data frame of column vectors of class factor (or one that can be coerced to that class) and non-empty column names.
pheno
a data frame of column vectors of class numeric if type = "cg" or class factor if type = "db" and non-empty column names.
constraints
an optional list of constraints on the edges for specifying required and forbidden edges. See details.
learn
a boolean value. If TRUE (default), the network structure will be learnt using the PC algorithm in RHugin package. If FALSE, only conditional probabilities will be learnt.
edgelist
a list of edges to be provided if learn == FALSE.
type
specify the type of network. "cg" for Conditional Gaussian (default) and "db" for Discrete Bayesian.
alpha
a single numeric value specifying the significance level (for use with RHugin). Default is 0.001.
tol
a positive numeric value (optional) specifying the tolerance for EM algorithm to learn conditional probability tables (for use with RHugin). Default value is 1e-04. See learn.cpt for details.
maxit
a positive integer value (optional) specifying the maximum number of iterations of EM algorithm to learn conditional probability tables (for use with RHugin). See learn.cpt for details.

Value

  • Returns an object of class "gpfit".
  • gpa pointer to a compiled RHugin domain. There is a cpt table associated with each node in the network.
  • gp_nodesa data frame containing information about nodes for internal use with other functions.
  • gp_flaga character string specifying the type of network (Conditional Gaussian or Discrete Bayesian)

Details

The function fit.gnbp fits a conditional gaussian bayesian network at the specified level of significance alpha, to genotype-phenotype (QTL) data by the PC algorithm implemented in the RHugin package. The conditional probability tables are learnt for each node in the domain by the EM algorithm implemented in the RHugin package. Edges between the genotypes at SNP markers are not allowed and the genotypes are constrained to precede the phenotypes. The phenotypes should be either all numeric or all discrete. The function does not currently support mixture of discrete and continuous phenotypes. Additional domain knowledge in terms of edges should be provided as a list of constraints, the structure of which is described in detail in learn.structure. Briefly, the constraints argument is a list of two elements: directed and undirected. Each of these elements in turn should be a list with two elements: required and forbidden. The elements of required and forbidden must be a character vector of length two specifying the names of the nodes. See learn.cpt for details.

See Also

absorb.gnbp

Examples

Run this code
data(mouse)

## Simple example : Fit a bayesian network to genotype-phenotype data using the default values
fit.gnbp(mousegeno,mousepheno)

## Fit a bayesian network to genotype-phenotype data at a specified significance level
fit.gnbp(mousegeno,mousepheno,alpha = 0.1)

Run the code above in your browser using DataLab