tvsroc.Rnw
- % NOTE
- ONLY EDIT THE .Rnw FILE!!! The .tex file is % likely to be overwritten. % \VignetteDepends{Biobase, genefilter, ALL} % \VignetteIndexEntry{Differential Expression: testing for differential expression} % \VignetteKeywords{tutorial} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper,11pt]{article} \usepackage{a4wide} \usepackage{times}
\newcommand{\Robject}[1]{\texttt{#1}} \newcommand{\Rpackage}[1]{\textit{#1}}
\begin{document} \title{Testing for differential expression} \author{Wolfgang Huber} \maketitle % \tableofcontents
In this short exercise, we will explore two methods for selecting differentially expressed genes in a probe-by-probe manner. One method is based on hypothesis testing. We will use the $t$-test as a representant for this class of methods, which also comprises, for example, the Wilcoxon test and $F$-tests. Another method is based on the strength of discrimination, and is based on looking at properties of the Receiver Operating Characteristic Curves for each gene, if that gene were used as a discriminator.
First, let's load the necessary libraries and data.
<
We select the subset of B-cell ALLs whose molecular type is either \textit{BCR/ABL} or \textit{NEG}.
<
Now select a subset of probes whose intensities were above 300 in at least 25\% of the samples.
<
Define a function that produces a logical vector out of an \Robject{exprSet}. The length of the vector is the number of samples, and the vector is intended to describe a grouping of the samples e.g. for running a $t$-test.
<
Now perform a probe-by-probe $t$-test and look at the histogram of resulting $p$-values:
<
Another way to select genes is by the \textit{partial area under the curve} (\textit{pAUC}), where the curve is a \textit{receiver operating curve} (\textit{ROC}).
<
The following plot shows that large pAUC values correspond to large values of the $t$-statistic, but not necessarily the other way round:
<
Why are there no large values of \Robject{area} for very small values of \Robject{t}? What happens if you use
<
As a strategy to select genes from a microarray experiment (e.g. for follow-up studies), one might think of at least two strategies:
\begin{enumerate} \item choose all probes with a $p$-value less than some threshold (i.e. $t$-statistic larger than some threshold) \item choose all probes with a pAUC larger than some threshold \end{enumerate}
Let's investigate how the number of probes we would select either way depends on the number of \textit{samples} that we have. To this end, first define a wrapper function around \Robject{mt.teststat}.
<
A similar wrapper around \Robject{my.pAUC}:
<
However, resampling with that would become unbearably slow (someone needs to write a faster implementation of the functions \Robject{pAUX} and \Robject{rocdemo.sca}). So, for the purpose of this exercise, let's use a similar but slightly simpler criterion. The following function counts all those probes for which the fraction of samples in class 1 that has a value above the median of all samples is larger than larger than 0.75 or smaller than 0.25:
<
Now let's write a function that does some resampling for various data set sizes:
< plot(groupsize, mns, pch=16, col="#c03030",
ylim = c(min(mns-stds)-5, max(mns+stds)+5),
xlab = "groupsize",
ylab = "selected no. of diff. exp. genes",
main = selfun)
segments(groupsize, mns-stds, groupsize, mns+stds, col="red")
}
@
And run it
<
Which of the two criteria seems more reasonable?
\end{document}