Last data update: 2014.03.03

R: Combining replicates for each condition
bcombR Documentation

Combining replicates for each condition

Description

This function calculates the combined signal for each condition from replicates using Bayesian models. The inputs are gene expression levels and the probe-level standard deviation associated with expression measurement for each gene on each chip. The outputs include gene expression levels and standard deviation for each condition. This function was originally part of the pplr package. Although this function can be called directly, it is recommended to use the pumaComb function instead, which can work directly on ExpressionSet objects, and can automatically determine which arrays are replicates.

Usage

bcomb(e, se, replicates, method=c("map","em"), 
      gsnorm=FALSE, nsample=1000, eps=1.0e-6)

Arguments

e

a data frame containing the expression level for each gene on each chip.

se

a data frame containing the standard deviation of gene expression levels.

replicates

a vector indicating which chip belongs to which condition.

method

character specifying the method algorithm used.

gsnorm

logical specifying whether do global scaling normalisation or not.

nsample

integer. The number of sampling in parameter estimation.

eps

a numeric, optimisation parameter.

Details

Each element in replicate represents the condition of the chip which is in the same column order as in the expression and standard deviation matrix files.

Method "map" uses MAP of a hierarchical Bayesion model with Gamma prior on the between-replicate variance (Gelman et.al. p.285) and shares the same variance across conditions. This method is fast and suitable for the case where there are many conditions.

Method "em" uses variational inference of the same hierarchical Bayesion model as in method "map" but with conjugate prior on between-replicate variance and shares the variance across conditions.

The parameter nsample should be large enough to ensure stable parameter estimates. Should be at least 1000.

Value

The result is a data frame with components named 'M1', 'M2', and so on, which represent the mean expression values for condition 1, condition 2, and so on. It also has components named 'Std1', 'Std2', and so on, which represent the standard deviation of the gene expression values for condition 1, condtion 2, and so on.

Author(s)

Xuejun Liu, Marta Milo, Neil D. Lawrence, Magnus Rattray

References

Gelman,A., Carlin,J.B., Stern,H.S., Rubin,D.B., Bayesian data analysis. London: Chapman & Hall; 1995.

Liu,X., Milo,M., Lawrence,N.D. and Rattray,M. (2006) Probe-level variances improve accuracy in detecting differential gene expression, Bioinformatics, 22:2107-2113.

See Also

Related methods pumaComb, mmgmos and pplr

Examples

  data(exampleE)
  data(exampleStd)
  r<-bcomb(exampleE,exampleStd,replicates=c(1,1,1,2,2,2),method="map")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(puma)
Loading required package: oligo
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: oligoClasses
Welcome to oligoClasses version 1.34.0
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: Biostrings
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: XVector
================================================================================
Welcome to oligo version 1.36.1
================================================================================
Loading required package: mclust
Package 'mclust' version 5.2
Type 'citation("mclust")' for citing this R package in publications.
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/puma/bcomb.Rd_%03d_medium.png", width=480, height=480)
> ### Name: bcomb
> ### Title: Combining replicates for each condition
> ### Aliases: bcomb
> ### Keywords: manip models
> 
> ### ** Examples
> 
>   data(exampleE)
>   data(exampleStd)
>   r<-bcomb(exampleE,exampleStd,replicates=c(1,1,1,2,2,2),method="map")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>