Last data update: 2014.03.03

R: Tools for Meta-analysis of gene expression data.
zScoresR Documentation

Tools for Meta-analysis of gene expression data.

Description

A small number of meta-analysis functions for computing zScores for FEM and REM and computing FDR.

Usage

zScores(esets, classes, useREM=TRUE, CombineExp=1:length(esets))
zScorePermuted(esets, classes, useREM=TRUE, CombineExp=1:length(esets))
zScoreFDR(esets, classes, useREM=TRUE, nperm=1000, CombineExp=1:length(esets))
multExpFDR(theScores, thePermScores, type="pos")

Arguments

esets

A list of ExpressionSets, one expression set per experiment. All experiments must have the same variables(genes).

classes

A list of class memberships, one per experiment. Each list can only contain 2 levels.

useREM

A logical value indicating whether or not to use a REM, TRUE, or a FEM, FALSE, for combining the z scores.

theScores

A vector of scores (e.g. t-statistics or z scores)

thePermScores

A vector of permuted scores (e.g. t-statistics or z scores)

type

"pos", "neg" or "two.sided"

nperm

number of permutations to calculate the FDR

CombineExp

vector of integer- which experiments should be combined-default:all experiments

Details

The function zScores implements the approach of Choi et al. for for a set of ExpressionSets. The function zScorePermuted applies zScore to a single permutation of the class labels. The function zScoreFDR computes a FDR for each gene, both for each single experiment and for the combined experiment. The FDR is calculated as described in Choi et al. Up to now ties in the zscores are not taken into account in the calculation. The function might produce incorrect results in that case. The function also computes zScores, both for the combines experiment and for each single experiment.

Value

A matrix with one row for each probe(set) and the following columns:

zSco_Ex_

For each single experiment the standardized mean difference, Effect_Ex_, divided by the estimated standard deviation, the square root of the EffectVar_Ex_ column.

MUvals

The combined standardized mean difference (using a FEM or REM)

MUsds

The standard deviation of the MUvals.

zSco

The z statistic - the MUvals divided by their standard deviations, MUsds.

Qvals

Cochran's Q statistic for each gene.

df

The degree of freedom for the Chi-square distribution. This is equal to the number of combined experiments minus one.

Qpvalues

The probability that a Chi-square random variable, with df degrees of freedom) has a higher value than the value from the Q statistic.

Chisq

The probability that a Chi-square random variate (with 1 degree of freedom) has a higher value than the value of zSco^2.

Effect_Ex_

The standardized mean difference for each single experiment.

EffectVar_Ex_

The variance of the standardized mean difference for each single experiment.

Note that the three column names that end in an underscore are replicated, once for each experiment that is being analyzed.

Author(s)

M. Ruschhaupt

References

Choi et al, Combining multiple microarray studies and modeling interstudy variation. Bioinformatics, 2003, i84-i90.

Examples

data(Nevins)

##Splitting 
thestatus  <- Nevins$ER.status
group1     <- which(thestatus=="pos")
group2     <- which(thestatus=="neg")
rrr        <- c(sample(group1, floor(length(group1)/2)),
                sample(group2,ceiling(length(group2)/2)))
Split1     <- Nevins[,rrr]
Split2     <- Nevins[,-rrr]

#obtain classes
Split1.ER <- as.numeric(Split1$ER.status) - 1
Split2.ER <-as.numeric(Split2$ER.status) - 1

esets     <- list(Split1,Split2)
classes   <- list(Split1.ER,Split2.ER)
theScores <- zScores(esets,classes,useREM=FALSE)
theScores[1:2,]

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(GeneMeta)
Loading required package: Biobase
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

Welcome to Bioconductor

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

Loading required package: genefilter
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/GeneMeta/zscore.Rd_%03d_medium.png", width=480, height=480)
> ### Name: zScores
> ### Title: Tools for Meta-analysis of gene expression data.
> ### Aliases: zScores multExpFDR zScoreFDR zScorePermuted
> ### Keywords: manip
> 
> ### ** Examples
> 
> data(Nevins)
> 
> ##Splitting 
> thestatus  <- Nevins$ER.status
> group1     <- which(thestatus=="pos")
> group2     <- which(thestatus=="neg")
> rrr        <- c(sample(group1, floor(length(group1)/2)),
+                 sample(group2,ceiling(length(group2)/2)))
> Split1     <- Nevins[,rrr]
> Split2     <- Nevins[,-rrr]
> 
> #obtain classes
> Split1.ER <- as.numeric(Split1$ER.status) - 1
> Split2.ER <-as.numeric(Split2$ER.status) - 1
> 
> esets     <- list(Split1,Split2)
> classes   <- list(Split1.ER,Split2.ER)
> theScores <- zScores(esets,classes,useREM=FALSE)
> theScores[1:2,]
            zSco_Ex_1  zSco_Ex_2       zSco     MUvals     MUsds     Qvals df
A28102_at   0.1645604 -0.8331361 -0.4701736 -0.1393250 0.2963268 0.5001327  1
AB000114_at 0.2116962 -1.0875824 -0.6135737 -0.1823248 0.2971523 0.8511781  1
             Qpvalues    Chisq Effect_Ex_1 Effect_Ex_2 EffectVar_Ex_1
A28102_at   0.4794418 0.638231  0.06871160  -0.3504246      0.1743451
AB000114_at 0.3562193 0.539497  0.08841004  -0.4599344      0.1744123
            EffectVar_Ex_2
A28102_at        0.1769119
AB000114_at      0.1788411
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>