BGmix-package: BGmix fits a variety of Bayesian hierarchical models for...

Description Details Author(s) References Examples

Description

BGmix uses a C++ routine to fit the chosen model via an MCMC algorithm. Files are written to a sub-directory in the working directory. The package includes R functions for reading the results into R, and several plotting functions and functions for estimating error rates.

Details

Package: BGmix
Type: Package
Version: 1.0
Date: 2007-02-01
License: GPL

See Vignette for details of how to use this package (use openVignette()).

Author(s)

Alex Lewin and Natalia Bochkina

Maintainer: Alex Lewin <a.m.lewin@imperial.co.uk>

References

Lewin, A., Bochkina, N. and Richardson, S. (2007), Fully Bayesian mixture model for differential gene expression: simulations and model checks. http://www.bgx.org.uk/publications.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Note this is a very short MCMC run!
## For good analysis need proper burn-in period.
data(ybar,ss)
outdir <- BGmix(ybar, ss, c(8,8), nburn=0, niter=100, nthin=1,trace.pred=1)

## Basic plot of parameters
params <- ccParams(outdir)
plotBasic(params,ybar,ss)

## plots of FDR and related quantities
fdr <- calcFDR(params)
par(mfrow=c(1,2))
plotFDR(fdr)

## plots of Bayesian p-values
## for predictive checks of mixture prior 
pred <- ccPred(outdir,q.trace=TRUE)
plotPredChecks(pred$pval.ybar.mix2,params$pc,probz=0.5)

## plots of predictive density superimposed on data
plotMixDensity(params,pred,ybar,ss)

Example output

Loading required package: KernSmooth
KernSmooth 2.23 loaded
Copyright M. P. Wand 1997-2009
[1] "Mixture prior on comp. 2"
[1] "delta ~ Gamma, MH"
[1] "eta (scale of Gamma) updated"
[1] "lambda (shape of Gamma) not updated"
[1] "Normal Likelihood"
[1] "tau ~ Gamma"
[1] "a (prior for tau) is updated"
[1] "trace output for parameters"
[1] "trace output for predicted data"
 Burn-in: 

 Main up-dates: 
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 
[1] "Output directory is ./run.1"
[1] "got beta"
[1] "got sig2"
[1] "got zg"
[1] "These plots are designed for differential expression model."
[1] "No. DE genes for FDR<=5% is  160"
[1] "No. DE genes for FDR<=10% is  185"
Read 1000 items
Read 200000 items
[1] "got ybar.pred1"
Read 200000 items
[1] "got ybar.pred2"
Read 200000 items
[1] "got ybar.pred3"
Read 200000 items
[1] "got ybar.pred4"
Read 200000 items
[1] "got ss.pred1"
Read 200000 items
[1] "got ss.pred2"
[1] 86
[1] 778
[1] 81

BGmix documentation built on Nov. 8, 2020, 4:54 p.m.