Title: Basic Statistical Analysis of Array Data
1Basic Statistical Analysis of Array Data
- EPP 245
- Statistical Analysis of
- Laboratory Data
2Fitting a model to genes
- We can fit a model to the data of each gene after
the whole arrays have been background corrected,
transformed, and normalized - Each gene is then test for whether there is
differential expression
3gt dim(exprs(eset)) 1 12625 12 gt
exprs(eset)942, LN0A.CEL LN0B.CEL LN1A.CEL
LN1B.CEL LN2A.CEL LN2B.CEL LN3A.CEL LN3B.CEL
9.063619 9.427203 9.570667 9.234590 8.285440
7.739298 8.696541 8.876506 LN4A.CEL LN4B.CEL
LN5A.CEL LN5B.CEL 9.425838 9.925823 9.512081
9.426103 gt group lt- as.factor(c(0,0,1,1,2,2,3,3,4
,4,5,5)) gt group 1 0 0 1 1 2 2 3 3 4 4 5
5 Levels 0 1 2 3 4 5 gt anova(lm(exprs(eset)942,
group)) Analysis of Variance Table Response
exprs(eset)942, Df Sum Sq Mean Sq F
value Pr(gtF) group 5 3.7235 0.7447
10.726 0.005945 Residuals 6 0.4166 0.0694
--- Signif. codes 0
0.001 0.01 0.05 . 0.1 1
4getp lt- function(y) tmp lt- anova(lm(y
group))P1 return(tmp) allp lt-
function(array) tmp2 lt- apply(array,1,getp)
return(tmp2) gt source("allgenes.r") gt allp1 lt-
allp(exprs(eset)) gt length(allp1) 1 12625
5(No Transcript)
6Multiplicity Adjustments
- If we test thousands of genes and pick all the
ones which are significant at the 5 level, we
will get hundreds of false positives. - Multiplicity adjustments winnow this down so that
the number of false positives is smaller
7Types of Multiplicity Adjustments
- The Bonferroni correction aims to detect no
significant genes at all if there are truly none,
and guarantees that the chance that any will be
detected is less than .05 under these conditions - Generally, this is too conservative
- Less conservative versions include methods due to
Holm, Hochberg, and Benjamini and Hochberg (FDR)
8(No Transcript)
9gt allp1adj lt- p.adjust(allp1,"fdr") gt
sum(allp1adjlt.05) 1 119 gt featureNames(eset)all
p1adj lt .05 1 "120_at"
"1288_s_at" 3 "1423_at"
"1439_s_at" 5
"1546_at" "1557_at"
............................................
.. 101 "41058_g_at" "411_i_at"
103 "41206_r_at"
"41501_at" 105 "41697_at"
"41733_at" 107
"476_s_at" "613_at"
109 "646_s_at" "672_at"
111 "769_s_at"
"777_at" 113 "801_at"
"922_at" 115
"952_at" "AFFX-BioB-M_at"
117 "AFFX-HUMGAPDH/M33197_3_at"
"AFFX-M27830_5_at" 119
"AFFX-M27830_M_at"
10LMGene
- LMGene is a Bioconductor package for linear model
analysis of gene expression data. - It can duplicate the small program which does a
one-way ANOVA for each gene, or any other linear
model. - It also can compute the moderated t or F
statistic, in which small denominators are made
larger and large denominators are made smaller. - Install using Packages in R.
11Moderated Statistics
- If we conduct a one-way ANOVA for each of 12625
genes, then each F-statistic uses the 6df
denominator which estimates the true MSE. - We can do better if we assume that the true MSE
varies from gene to gene, but not arbitrarily.
12Distribution of denominators with 6df when the
true MSE is 6
13gt colnames(exprs(eset)) 1 "LN0A.CEL"
"LN0B.CEL" "LN1A.CEL" "LN1B.CEL" "LN2A.CEL"
"LN2B.CEL" 7 "LN3A.CEL" "LN3B.CEL" "LN4A.CEL"
"LN4B.CEL" "LN5A.CEL" "LN5B.CEL" gt group lt-
factor(c(0,0,1,1,2,2,3,3,4,4,5,5)) gt vlist lt-
list(groupgroup) gt vlist group 1 0 0 1 1 2 2
3 3 4 4 5 5 Levels 0 1 2 3 4 5 gt eset.lmg lt-
neweS(exprs(eset),vlist) gt lmg.results lt-
LMGene(eset.lmg)
This results in a list of 1173 genes that are
differentially expressed after using the
moderated F statistic. Compare to 119 if the
moderated statistic is not used. We will see
next time how to understand the biological
implications of the results
14gt genediff.results lt- genediff(eset.lmg) gt
names(genediff.results) 1 "Gene.Specific"
"Posterior" gt hist(genediff.resultsGene.Speci
fic) gt hist(genediff.resultsPosterior) gt pv2 lt-
pvadjust(genediff.results) gt names(pv2) 1
"Gene.Specific" "Posterior"
"Gene.Specific.FDR" 4 "Posterior.FDR" gt
sum(pv2Gene.Specific lt .05) 1 2615 gt
sum(pv2Posterior lt .05) 1 3082 gt
sum(pv2Gene.Specific.FDR lt .05) 1 119 gt
sum(pv2Posterior.FDR lt .05) 1 1173
Using genediff results in two lists of 12625
p-values. One uses the standard 6df denominator
and the other uses the moderated F-statistic
with a denominator derived from an analysis of
all of the MSEs from all the linear models.
15(No Transcript)
16(No Transcript)
17Using LMGene for More Complex Models
- The eS object contains a matrix of data and a
list of variables that can be used for the linear
model - An optional second argument is the linear model
that is fit to the data. - The default is to use all the variables as main
effects with no interactions.
18- Suppose the data consist of 32 arrays from 8
patients at each of 4 doses (in this case of
ionizing radiation) of 0, 1, 10, and 100 cGy. - We specify each variable, make a list for the eS,
and then write the model if necessary.
19gt patient lt- factor(rep(18,each4)) gt patient
1 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6
6 7 7 7 7 8 8 8 8 Levels 1 2 3 4 5 6 7 8 gt dose
lt- rep(c(0,1,10,100),8) gt dose 1 0 1 10
100 0 1 10 100 0 1 10 100 0 1 10
100 17 0 1 10 100 0 1 10 100 0 1
10 100 0 1 10 100 gt vlist lt-
list(patientpatient, dosedose) gt eset.rads lt-
neweS(exprs(eset),vlist) gt rads.results lt-
LMGene(eset.rads) gt rads.results lt-
LMGene(eset.rads,patientdose) gt rads.results
lt- LMGene(eset.rads,patientdose)
The operator means an additive model, the
operator means the factors/variables and all
interactions, the operator just adds the
interactions. y patientdose y patientdose
patientdosepatientdose y
patientdosetimepatientdose
20Exercises
- For the sample affy data, fit the oneway ANOVA
model to the RMA processed data. Adjust the
p-values for FDR. Try googling some of the affy
feature names for the significant genes.