\documentclass[11pt]{article}

\special{papersize=8.5in,11in}

\renewcommand{\baselinestretch}{1.3}

\usepackage{fullpage,amsmath,amssymb,float,fancybox,harvard,url}

\newcommand{\edge}{{\tt EDGE }}

\newcommand{\edgens}{{\tt EDGE}}

\newcommand{\p}{{\bf Pr}}

\newcommand{\e}{{\bf E}}

\newcommand{\q}{\mbox{q}}

\newcommand{\dd}{\lambda}

\newcommand{\hk}{\hat{k}}

\newcommand{\argmin}{\mbox{argmin}}

\newcommand{\argmax}{\mbox{argmax}}

\newcommand{\ga}{\Gamma}

\newcommand{\gm}{t}

\newcommand{\al}{\alpha}

\newcommand{\var}{{\bf Var}}

\newcommand{\cov}{{\bf Cov}}

\newcommand{\no}{\noindent}

\newcommand{\bh}{\widehat}

\newcommand{\bt}{\widetilde}

\newcommand{\ta}{t_{\alpha}}

\newcommand{\real}{\mathbb{R}}

\newcommand{\cn}{\citeasnoun}

\newcommand{\pc}{\possessivecite}

\newcommand{\iid}{\stackrel{i.i.d}{\sim}}

\def\Argmax{\mathop{\rm arg\,max}\limits}%    a math operator.

\def\Argmin{\mathop{\rm arg\,min}\limits}%    a math operator.

\newcommand{\blue}{\textcolor{blue}}

\newcommand{\red}{\textcolor{red}}

\newcommand{\sub}[1]{\medskip \noindent {\bf {#1}}}

\usepackage{graphicx}

\begin{document}

\setcounter{page}{0}

\ 

\bigskip

\bigskip

\bigskip

\bigskip

\bigskip

\centerline{\includegraphics[width=4.5in]{edge.jpg}}
\begin{center} \Large
THE MANUAL

\bigskip

\bigskip

\bigskip

\bigskip

Jeffrey T. Leek, Eva Monsen, \\ 
Alan R. Dabney, and John D. Storey \\
Department of Biostatistics \\
Department of Genome Sciences \\
University of Washington \\

\bigskip

\bigskip

\bigskip

\bigskip

\url{http://faculty.washington.edu/jstorey/edge/}

\end{center}

\normalsize

\newpage
\tableofcontents

\newpage
\listoffigures


\newpage
\section{Overview} 

\edge is a point-and-click, open-source software package for the analysis of expression data. The main purpose of the software is to perform significance analyses on comparative microarray experiments.  Because there are many steps that need to be performed along with a significance analysis, we have attempted to include what we have found to be the core analysis procedures. In addition to the significance analysis procedures for identifying differentially expressed genes, \edge includes functions for data visualization, transformation, exploratory analysis, and NCBI queries.  All procedures implemented in the software are based on sound statistical procedures that have appeared or are scheduled to appear in peer-reviewed articles.  \edge is cross-platform compatible (Windows, Mac, Linux and Unix), running on top of the {\tt R} statistical software package \cite{rmanual}.  It does not require the user to employ any closed-source software.

Using new statistical theory \cite{Storey07,SDL07}, \edge allows one to identify genes that are differentially expressed between two or more different biological conditions (e.g., healthy versus diseased tissue).  There are already a number of software packages to perform this type of analysis.  However, \edge is based on the Optimal Discovery Procedure (ODP) that we recently introduced, which is significantly different from existing approaches.  Whereas previously existing methods employ statistics that are essentially designed for testing one gene at a time (e.g., t-statistics and F-statistics), the ODP uses all relevant information from all genes in order to test each one for differential expression.  The improvements in power are substantial; Figure \ref{fig.edgecomp} shows a comparison between \edge and five leading software packages, based on a well-known breast cancer expression study \cite{Hedenfalk01}.

\edge also allows one to perform significance analysis on {\em time course} experiments \cite{Storey05a}.  Two types of time course significance analyses are possible. One type allows the user to test for genes whose expression changes over time.  The other allows the user to identify genes who show different expression over time between two or more biological conditions.  Even though some significance analysis packages allow for users to enter information about time points, we have a rigorously developed set of methodology that was recently published in \cn{Storey05}. There are many things that can go wrong when applying methods originally developed for traditional ``static'' analyses to time course experiments, so it is important to use a method that has been specifically designed and justified for this setting.

\subsection{Contributors}

\edge was written by Jeffrey Leek, Eva Monsen, Alan Dabney, and John Storey.

\subsection{Citations}

The ``static sampling'' differential expression analysis is carried out according to \cn{SDL07}. The ``time course'' differential expression analysis is carried out according to \cn{Storey05a}.  \cn{LMDS05} can be used to cite this software in general. The other previously existing methods that we have implemented into \edge are cited and described below.


\section{Getting Started} 

\subsection{Installing and Starting \edge}
\sub{Windows Installation}
\begin{enumerate}
\item Download the latest version of {\tt R} from \url{http://cran.r-project.org/}.
\item Download the latest version of the \edge installation executable for Windows from the download web site provided when obtaining a license.
\item Double-click this installation file and follow all default settings. An \edge icon will appear on your desktop and in the start menu, and all \edge files will be stored in \newline {\tt C:$\backslash$Program Files$\backslash$R$\backslash$EDGE$\backslash$}.
\item Double-click the \edge icon to start the software. An \edge window will open as in Figure \ref{fig.main}. Its corresponding {\tt R} window will also open but will be minimized.
\end{enumerate}

\sub{Macintosh Installation}
\begin{enumerate}
\item Install X11 from the installation dvd that comes with all Macs.
\item Install the latest version of {\tt R} from \url{http://cran.r-project.org/}.  We recommend that you perform a default installation.
\item Download the most recent \edge bundle from the download web site provided when obtaining a license; if the  {\tt edge\_X.Y.Z.tar.gz} file doesn't automatically unstuff, double click it and an \edge folder will appear. 
\item Move the resulting \edge folder to your {\tt Applications} folder. 
\item Inside the \edge folder is a blue \edgens.app file.  Drag this icon to your dock.
\item Click on the icon to start \edge.  We recommend that you close all X11 windows before starting \edgens.
\end{enumerate}

\sub{Linux/Unix Installation}
\begin{enumerate}
\item Install the latest version of {\tt R} from  \url{http://cran.r-project.org/}. Also make certain that the latest version of Tcl/Tk is installed on your operating system.
\item Download the most recent \edge bundle from the download web site provided when obtaining a license.
\item Open a terminal, {\tt cd} to the directory where {\tt edge\_X.Y.Z.tar.gz} is saved and type: \newline
\quad {\tt gzip -d edge\_X.Y.Z.tar.gz} \newline
\quad {\tt tar xvf edge\_X.Y.Z.tar}
\item To compile \edgens, type {\tt make install} in the {\tt edge\_X.Y.Z/src/} directory.

\item To start \edgens, {\tt cd} to the {\tt EDGE/} directory that was just created and type {\tt R}.  After the {\tt R} session starts, type {\tt source("edge.r")} at the {\tt R} prompt. To launch the graphical interface, then type {\tt edge()} at the {\tt R} prompt.
\end{enumerate}

\subsection{The Main \edge Window}

Figure \ref{fig.main} shows the main \edge window that will appear once the software is started.  There are eight different functions that can be performed:
\begin{quote}
$\bullet$ {\tt Load/Save Expression Data and Covariates} \\
$\bullet$ {\tt Impute Missing Data} \\
$\bullet$ {\tt View Covariates} \\
$\bullet$ {\tt Transform Data} \\ 
$\bullet$ {\tt Display Boxplots} \\
$\bullet$ {\tt Display Hierarchical Clustering} \\
$\bullet$ {\tt Display Eigengenes and Eigenarrays} \\
$\bullet$ {\tt Identify Differentially Expressed Genes}
\end{quote}
The remaining sections explain how to employ each of these functions. In order to initiate a function, select it with your mouse and press {\tt GO}.  The main window will remain visible for all functions except for {\tt Display Hierarchical Clustering}. Information and error messages will appear in the message box of the main \edge window.

\section{Formatting and Loading Data} 

\subsection{Data File Format} \label{sec.dataformat}

There is a special format for the expression data files loaded into \edgens. All data files should be saved as tab-delimited text files, which can easily done from Microsoft Excel or {\tt R}. There should be two files for any analysis: a file containing the expression measurements and a file containing the relevant variables (called ``covariates'') that give information about each array.  

\sub{The expression input file.} The first file is the expression input file and should be formated according to the examples below in Tables \ref{tab.data1} and \ref{tab.data2}.  The first row consists of descriptions of each column.  The array names will likely be specific to some nomenclature your lab has adopted. In the simplest format (Table \ref{tab.data1}), the first column consists of gene names for the genes being analyzed. If the user desires to use the web searching option after differential expression analysis, the gene names should be either UIDs or accession numbers. The remaining columns are filled with the appropriate expression values.  The second format (Table \ref{tab.data2}) is similar to the first, except that a ``Description'' column is included as the second column of the expression input. The description column may consist of a small phrase describing each gene, or other important information.  It is important to emphasize that entries within a row must be tab-delimited for either type of file~format.

\begin{table}[h]
\begin{center}
\caption{Example expression data input file. \label{tab.data1}}
{\tt 
\begin{tabular}{lllllllllll} \hline

Gene Name & Array1 & Array2 & Array3 & Array4 & Array5 & Array6 \\ 
300001\_at & 3033.46 & 726.092 & 1718.15 & 999.01 & 1132.34 & 1128.04 \\ 
300002\_s\_at & 1087.45 & 789.734 & 1106.86 & 956.63 & 1253.77 & 1298.48 \\ 
300003\_at & 12238.7 & 4868.51 & 8166.45 & 8277.71 & 7760.86 & 10289.5 \\
300004\_s\_at & 1111.43 & 936.013 & 928.879 & 1570.06 & 1630.54 & 1941.9 \\ 
$\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\
308136\_s\_at & 1840.85 & 626.16 & 817.791 & 1361.28 & 1216.51 & 1511.81 \\ \hline
\end{tabular}
}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\caption{Example expression data file with a ``Description'' column. \label{tab.data2}}
\small
{\tt 
\begin{tabular}{lllllllllll} \hline

Gene Name & Description & Array1 & Array2 & Array3 & Array4 & Array5 & Array6 \\ 
300001\_at & metabolism & 3033.46 & 726.092 & 1718.15 & 999.01 & 1132.34 & 1128.04 \\ 
300002\_s\_at & immune\,response & 1087.45 & 789.734 & 1106.86 & 956.63 & 1253.77 & 1298.48 \\ 
300003\_at & ribosomal\,protein & 12238.7 & 4868.51 & 8166.45 & 8277.71 & 7760.86 & 10289.5 \\
300004\_s\_at & unknown & 1111.43 & 936.013 & 928.879 & 1570.06 & 1630.54 & 1941.9 \\ 
$\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$\\
308136\_s\_at & metabolism & 1840.85 & 626.16 & 817.791 & 1361.28 & 1216.51 & 1511.81 \\ \hline
\end{tabular}
}
\normalsize
\end{center}
\end{table}

\sub{The covariate input file.} The second file is the covariate input file and should be formatted as in Table \ref{tab.cov}. Again, this file should be saved as a tab-delimited text file. The first row should be identical to the first row of the expression data file.  The top left entry is not actually used, so we have written it as ``Cov Name'' here instead of ``Gene Name''; one can also leave this particular entry blank. Each subsequent row should contain the name for a covariate, followed by its values across the arrays.  If the covariate is categorical (meaning that it describes unordered classes), then one can code this variable by different numbers or by different words.  For example, rows 2, 3, and 5 of Table \ref{tab.cov} are all categorical variables.  If the covariate is numerical, then one must code this variable by the number to be used for each array, as in row 4 of Table \ref{tab.cov}.  It is possible to incorporate dependent, {\em matched} arrays into your \edge analysis.  As of now, matching can only occur between pairs of arrays.  Row 6 of Table \ref{tab.cov} shows how matching should be coded: any two arrays that are matched should have the same number, and every pair should be denoted by a different number.

\begin{table}[h]
\begin{center}
\caption{Example covariate input file. \label{tab.cov}}
{\tt 
\begin{tabular}{lllllllllll}  \hline

Cov Name & Array1 & Array2 & Array3 & Array4 & Array5 & Array6 \\ 
Treatment & drug & drug & control & drug & control & control \\
Age & 24 & 62 & 33 & 35 & 22 & 59 \\
Batch & first & first & first & second & second & second \\
Disease & 0 & 1 & 1 & 0 & 1 & 0 \\
Matching & 1 & 3 & 2 & 2 & 1 & 3 \\ \hline
\end{tabular}
}
\end{center}
\end{table}

\subsection{Loading Data} \label{sec.load}

Select the {\tt Load/Save Expression Data and Covariates} function.  There are respective boxes for loading the expression data file and the covariate data file.  You may either type the path of these files directly or select {\tt Browse} and locate the files by point-and-click.  Once the file path has been selected, press the {\tt Load} button, and the respective file will be loaded.  A summary of the file will be displayed in the message box.  When loading the expression data file, there are two additional options.  If there are missing data, the user should enter the exact character string that denotes missing data (only one missing data string is possible).  If there is a ``Description Column'' (see Table \ref{tab.data2}), then check the corresponding box; otherwise this will generate an error when loading the file.

\subsection{Saving the \edge Session as an {\tt R} Image}

At any point during an \edge session, it is possible to save all of the currently available information as an {\tt R} image file. This is a more advanced option, but we may make it more user-friendly in the future.  In order to save the \edge session, click {\tt Save}, select the folder where you wish to save the image file, and type the name of the image file.  Note that it is best to give the file the suffix {\tt .RData}. The next time that \edge is started, the image file can be loaded from the {\tt R} command line (which is usually present in another window) by typing {\tt load("path\_to\_file/yourfile.RData")} at the {\tt R} command prompt.

\subsection{Example Data Sets} \label{sec.data}

Sample data sets are included in the \edge package for demonstration purposes. The example data sets appear in the folder \url{data}, which is located in the {\tt EDGE} folder. 

\sub{BRCA-mutation-positive Tumor Study.}  The BRCA data set is a subset of 3170 genes on 15 arrays from the \cn{Hedenfalk01} study. The data set is contained in the file {\tt brca.txt} and the covariate information is contained in the file {\tt brca\_cov.txt}. The covariate included in {\tt brca\_cov.txt} is named {\tt Mutation}, which has two values, {\tt BRCA1} and {\tt BRCA2}. This data set can be used to test for two-sample static differential expression, i.e., genes that are differential expressed between the {\tt BRCA1} and {\tt BRCA2} groups. 

\sub{Endotoxin Study.} The endotoxin data set is a subset of 800 genes on 46 arrays from the \cite{Glue04,Storey05} studies. The expression data are contained in the file {\tt endo.txt} and the covariate information is contained in the file {\tt endo\_cov.txt}. The covariates included in {\tt endo\_cov.txt} are {\tt Treatment}, {\tt Individual}, and {\tt Hour}. This is a time course study, so each array corresponds to a time point collected from a certain individual. {\tt Treatment} indicates whether the array comes from an individual who received endotoxin or served as a control. {\tt Individual} denotes which arrays correspond to which individuals. {\tt Hour} gives the hour in the study during which the array was collected. This data set is appropriate for performing a ``between-class'' differential expression analysis.
 
\sub{Simulated Data Set with Matching.} This data set contains 1000 simulated genes on 10 arrays. The data sets are contained in the files {\tt sim\_match.txt} and the covariate information is contained in the file {\tt sim\_match\_cov.txt}. The covariates included in {\tt sim\_match\_cov.txt} are {\tt Match} and {\tt Response}. {\tt Match} contains the matching indicators; for example, array1 is matched with array6 since they are both labeled with a ``1'' in the matching variable. The {\tt Response} is an indicator of some treatment effect. This data set is appropriate for performing a matched two-sample static differential expression analysis. This data set has missing values denoted by {\tt NA}, so it can be used to test the missing data imputation function. 

\section{Data Preprocessing and Visualization} 

\subsection{Imputing Missing Data}

Many methods for analyzing gene expression microarray experiments are not designed to handle missing data directly. ``$K$ nearest neighbor'' (KNN) imputation replaces the missing expression values for a gene using expression information from the $K$ ``most similar'' complete genes, where a complete gene has no missing expression values in the data set. The $K$ most similar complete genes are the $K$ complete genes that are closest in Euclidean distance to the gene with missing values \cite{Troyanskaya01}. The missing expression measurement on an array is imputed as the mean of the measurements from the K nearest complete genes for that array. To open the imputation window, select {\tt Impute Missing Data} in the main menu, and press {\tt GO}. You should now see a window similar to Figure \ref{fig.impute}.
  
Click {\tt CALCULATE MISSING DATA STATISTICS} to calculate and display the percent of missing values in genes, arrays, and overall. Two settings are available in the {\tt KNN parameters} frame. Set the percent of missing values to tolerate in a gene to eliminate genes in the data set with a percent of missing values higher than the tolerance. If no genes should be eliminated from the data set, the tolerance should be set to 100. Set the number of nearest neighbors to use to determine the number of nearest neighbors used for imputing missing values, up to the number of complete genes in the data set. After setting the KNN parameters click {\tt GO} to perform the imputation.  Click {\tt DONE} to return to the main menu. 

\subsection{Viewing Covariate Information}

After loading expression data and covariate information, check the covariate information for accuracy by selecting {\tt View Covariates} from the main menu and pressing {\tt GO}. You should see a window similar to Figure \ref{fig.covariate}. The covariate names are displayed, followed by the values currently loaded into \edgens. Click {\tt DONE} to return to the main menu after ensuring the covariate information is correct. 

\subsection{Transforming Data}

It is sometimes desirable to center and/or scale the expression measurements from each array. To open the data transformation window, select {\tt Transform Data} from the main menu and click {\tt GO}. You should see a window similar to Figure \ref{fig.transform}. 

There are three standard transformations that can be performed by the \edge software. Choose the appropriate options for taking the $\rm{log}_2$ transform, mean or median centering, and standard deviation or absolute deviation scaling. One may want to add a small positive constant to all of the expression measurements before taking the $\rm{log}_2$ transform. This can help to avoid taking the $\rm{log}_2$ of zero or a negative number (which is undefined) and it can also help to stabilize the variance of genes with low expression values. After setting the options, click {\tt GO} to perform the data transformation. Click {\tt DONE} to return to the main menu. 


\subsection{Display Boxplots}

Boxplots are a useful for viewing the distribution of large numbers of expression measurements. Boxplots indicate the median expression and give an indication of the spread of expression measurements within a defined group (e.g., an array). To view boxplots, select {\tt Display Boxplots} from the main menu and click {\tt GO}. You should see a window like Figure \ref{fig.boxplot}. It is possible to group the expression measurements by any covariate or by the arrays themselves. Choose a variable from the {\tt Boxplots by Covariate} frame to display one boxplot for each level of that covariate, or select {\tt Data Array Order} to display one boxplot per array. Choose the number of boxplots to display per screen, up to the maximum displayed in parentheses. 

Click {\tt OK} to display the number of boxplots you set above. You should see a plot similar to Figure \ref{fig.boxplot2}; above each boxplot appears the value of the covariate (or the array number). To see the next set of boxplots, click {\tt NEXT BOXPLOT} and continue until boxplots for all values of the covariate (or all arrays) have been displayed. Click {\tt DONE} to return to the main menu. 

\section{Pattern Discovery and Display}

\subsection{Hierarchical Clustering} \label{sec.cluster}

Hierarchical clustering organizes genes into groups with similar gene expression patterns \cite{Eisen98}.  Initially, each gene represents its own group.  Clusters are then built one gene at a time, where each gene is added to the group to which it is most similar, or ``nearest.''  When a group already includes more than one gene, \edge uses ``centroid linkage'' to compute distances to that group.  To open the clustering window, select {\tt Display Hierarchical Clustering} in the main menu, then press {\tt GO}.  You should now see a window similar to Figure \ref{fig.cluster}.

Two optional settings are available in the {\tt Cluster Options} frame.  \edge uses one of two distance metrics.  The squared {\tt Euclidean} distance between two genes is the sum of squared differences between each component, while the {\tt Correlation} distance between two genes is one minus their sample correlation.  After clustering, \edge reorders the genes, so that adjacent elements in a graphical display are most similar.  Because the {\tt Optimal} ordering \cite{BJoseph03} is very computationally intensive, a {\tt Heuristic} ordering routine \cite{Eisen98} is available as an alternative.  Once you have specified the options, click {\tt CLUSTER} to begin.  Progress will be monitored in the {\tt Clustering progress} frame.  Click {\tt CANCEL} at any time if you would like to stop the computation.

Once completed, you can view the results in a heatmap.  Several options are available in frame {\tt Plot Options}.  Choose whether you would like gene and/or array {\tt Labels} included on the plot.  Note that the plot will quickly become overly crowded if too many labels are included.  The choice of {\tt Coloring} can have a large impact on the visual interpretation of your results.  If there are a few expression measurements that are extreme relative to the others, then the majority of observations will be assigned the same (or very similar) color.  Choosing {\tt Logarithmic color scale} should help in this situation.  Similarly, you can choose between coloring by {\tt Value} or {\tt Rank}.  Choosing {\tt Rank} will also help in the above situation.  Under {\tt Scaling, Centering, and Transforms}, you can {\tt Center} each gene around its mean, forcing all genes to be centered at zero.  You can also remove extreme values from the plot under {\tt Truncate data values}.  This can be done by specifying either an {\tt Absolute cutoff} or {\tt Multiples of standard deviation}.  For example, if you specify a cutoff of 2, then only expression measurements with values less than 2 will be included in the plot.  Similarly, if you specify a standard deviation of 3, then only measurements which fall within three standard deviations of the overall mean will be plotted.  

Once you have specified the plotting options, click {\tt PLOT}.  This will cause {\tt R} to produce a plot similar to Figure \ref{fig.cluster2}.  Rows represent genes, and columns represent arrays.  The dendogram on the left describes the progression of the clustering routine, where branch lengths reflect the degree of similarity between the connected objects.  Colors range from blue on the low end of expression measurements to red on the high end.  In the cluster analysis of Figure \ref{fig.cluster2}, two large clusters are apparent.  In the larger cluster, there tends to be high expression in samples 1-7 and low expression in samples 8-15.  This relationship is switched in the smaller cluster.  You can now {\tt SAVE PLOT AS PDF} or change some of the options and {\tt PLOT AGAIN}.  Click {\tt DONE} to return to the main menu.

\subsection{Eigengenes and Eigenarrays}

Eigengenes are representations of common expression patterns across arrays \cite{Alter00}.  Similarly, eigenarrays are representations of common expression profiles across genes.  In mathematical terms, an eigengene is composed of coefficients for a linear combination of the arrays which accounts for a substantial amount of the total variation in the data.  Similarly, an eigenarray is a set of coefficients for a linear combination of the genes.  Each eigengene is orthogonal to any other eigengene, with the same relation holding for eigenarrays.  The amount of variation accounted for by each eigengene and eigenarray can be calculated.  With $m$ genes and $n$ arrays, there will be $n$ eigengenes and $n$ eigenarrays.  To open the ``eigen-analysis'' window, select {\tt Display Eigengenes and Eigenarrays} in the main menu, then press {\tt GO}.  You should now see a window similar to Figure \ref{fig.eigen}.

Select either {\tt Eigengenes} or {\tt Eigenarrays} under {\tt Plot}.  If you are interested in common expression patterns across something other than arrays, you can specify this under {\tt Plot by Variable}.  For example, in Figure \ref{fig.eigen}, the variables {\tt Treatment}, {\tt Individual}, and {\tt Hour} are listed in addition to {\tt Data Array Order}.  If {\tt Treatment} is selected, for example, then eigengenes will describe common expression patterns across treatment groups.  You can specify the number of plots to display at a time in {\tt Number to Plot}.  

Once you have specified all options, click {\tt OK}.  This will cause {\tt R} to produce a plot similar to Figure \ref{fig.eigen2}.  In this case, eigengenes have been computed across arrays.  The eigengene values are on the $y$-axis, and array number is on the $x$-axis.  The plot titles tell you the proportion of variation accounted for by each eigengene.  In this example, the first eigengene accounts for 61\% of all variation in the data.  We can interpret this as meaning that the single most influential expression pattern in these data roughly involves a change in the sign of expression between the first 25 arrays and the last 20 arrays.  Note that the direction of eigengene or eigenarray trends is irrelevant.  In particular, the first eigengene in Figure \ref{fig.eigen2} could equivalently be represented by rotating all points about the horizontal zero line.  Click {\tt Next} to display the next set of eigengenes or eigenarrays.  Click {\tt DONE} to return to the main menu.


\section{Identifying Differentially Expressed Genes} 

To perform a differential expression analysis, select the {\tt Identify Differentially Expressed Genes} option, then click {\tt GO}. The differential expression window will appear as in Figure 8. 

\subsection{Types of Differential Expression}

There are three experimental designs where \edge can identify differentially expressed genes.  The first is a ``static sampling'' experiment, which means that the arrays have been collected from distinct biological groups and without respect to time.  This has been the most common experimental design up till this point. The goal is to identify genes that have a statistically significant difference in average expression across these distinct biological groups.  When a two-channel microarray system is used, it is possible to measure gene expression from two populations of interest on a single array.  In this case, the arrays all come from a single ``group'' and a gene is said to be differentially expressed if its average {\em relative} expression (as a log-scale ratio) is different than zero.  

The second type of experiment is a time course experiment, where the arrays have been sampled with respect to time from one or more distinct biological groups.  If only one biological group has been sampled, then the goal is to identify genes that show ``within-class temporal differential expression'', i.e., genes that show statistically significant changes in expression over time. If two or more biological groups have been sampled, then the goal is to identify genes that show ``between-class temporal differential expression'', i.e., genes that show statistically significant differences in expression over time between the various groups.

The third type of experiment is a ``continuous response'' design, which means that the arrays have been collected from a continuously defined biological state and without respect to time.  The goal here is to identify genes whose expression shows a statistically significant change with respect to this continuous response. For example, arrays may be sampled from individuals where their blood pressure has been recorded, and the goal would be to identify genes whose expression changes with blood pressure.

\subsection{Static Sampling Studies}
Figure \ref{fig.diffex} shows the window that opens when the user selects the differential expression function. The top panel, {\tt Choose Class Variable}, should be used to select the variable that identifies the biological groups to be compared. If only one biological group has been sampled select {\tt None}.  Under the next panel, {\tt Differential Expression Type}, select {\tt Static (standard, non-time course sampling)}. 

%The user may now click the button {\tt STATIC SAMPLING SETTINGS}, and the window will appear as in Figure \ref{fig.diffex-static}. In the near future, there will be options to perform tests for over expression or under expression alone. In addition, the user will be able to test for fold change above a certain threshold by clicking the check box and entering the fold change of interest. However, these options are disabled in the current version of \edgens.  After choosing the appropriate options, click {\tt APPLY} to return to the differential expression menu. Click {\tt CANCEL} to return to the differential expression menu without setting static options. 

The user may now click the button {\tt STATIC SAMPLING SETTINGS}, but there are currently no additional settings to apply. In the near future, there will be options to perform tests for over- or under-expression alone. In addition, the user will be able to test for fold change above a certain threshold by clicking the check box and entering the fold change of interest.

The significance calculation is based on randomly permuting the group labels, so under the {\tt Number of null iterations} panel the user should choose the number of null iterations to be performed. If the total number of unique permutations is less than or equal to what the user has chosen, then \edge performs all unique permutations.  It may be important to be able to reproduce results exactly, in which case the user should choose a random seed under the {\tt Choose a seed for reproducible results} panel.  Once these steps are performed, click {\tt GO} and the calculations will begin. 

Information about the time remaining and percentage of calculations completed will be displayed throughout the calculations. If the calculation needs to be canceled, then click {\tt CANCEL}.  If you decide not to perform a differential expression analysis, then click {\tt DONE}. Once the calculations are completed, a results window will appear, which is described below in Section \ref{sec.results}.

\subsection{Time Course Studies}
Figure \ref{fig.diffex} shows the window that opens when the user selects the differential expression function. The top panel, {\tt Choose Class Variable}, should be used to select the variable that identifies the biological groups to be compared. If only one biological group has been sampled select {\tt None}.  Under the next panel, {\tt Differential Expression Type}, select {\tt Time Course}. 

The user may now click the button {\tt TIME COURSE SETTINGS}, and the window will appear as in Figure \ref{fig.diffex-time}.  You must select a covariate that denotes the time point at which each array was sampled. This variable should be selected in the top panel, {\tt Choose covariate giving time points}.  If individuals were sampled at more than one time point (making these arrays dependent), then the variable denoting which individual corresponds to which array should be selected under the second panel, {\tt Choose covariate corresponding to individuals}.

At the bottom of the window, there are options regarding the type of spline that is used to model the expression over time.  The first option is to choose between a natural cubic spline or polynomial spline. The natural cubic spline is suggested unless there are specific considerations that merit use of the polynomial spline. If desired, the user can also choose the basis dimension for the spline at the second option; if not specified the basis dimension will be chosen automatically. In some cases, it may also be necessary to determine baseline differences in expression over time in addition to changes over time. If this is the case, then click the button at the third option to include the intercept in the analysis. It should be noted that also detecting baseline differences is considerably more computationally intensive when longitudinal sampling has been employed, and it should only be used where appropriate. 

After choosing the appropriate options, click {\tt APPLY} to return to the differential expression menu. Click {\tt CANCEL} to return to the differential expression menu without setting time course options. 

Once these steps are performed, click {\tt GO} and the calculations will begin. Information about the time remaining and percentage of calculations completed will be displayed throughout the calculations. If the calculation needs to be canceled, then click {\tt CANCEL}.  If you decide not to perform a differential expression analysis, then click {\tt DONE}. Once the calculations are completed, a results window will appear, which is described below in Section \ref{sec.results}.

\subsection{Continuous Response Studies}

Figure \ref{fig.diffex} shows the window that opens when the user selects the differential expression function. The top panel, {\tt Choose Class Variable}, should be set at {\tt None}.  A continuous response study can be analyzed using a special set of choices for the time course options. Therefore, for the {\tt Differential Expression Type} panel, select {\tt Time Course}.

Now click the button {\tt TIME COURSE SETTINGS}, and the window will appear as in Figure \ref{fig.diffex-time}.  The covariate that denotes the continuous response should be selected in the top panel, {\tt Choose covariate giving time points}.  Under the second panel, {\tt Choose covariate corresponding to individuals}, select {\tt None}.

At the bottom of the window, there are options regarding the type of spline that is used to model the relationship of expression to the continuous response.  The first option is to choose between a natural cubic spline or polynomial spline. The natural cubic spline is suggested unless there are specific considerations that merit use of the polynomial spline, such as a desire for easier model interpretability. If desired, the user can also choose the basis dimension for the spline at the second option; if not specified the basis dimension will be chosen automatically. The dimension is defined so that a dimension of one is equivalent to a straight line, two equivalent to the complexity of a quadratic, etc. It is almost always {\em not} going to be appropriate to include the intercept in the analysis, so this box should {\em not} be checked.  

After choosing the appropriate options, click {\tt APPLY} to return to the differential expression menu. Click {\tt CANCEL} to return to the differential expression menu without setting any options. 

Once these steps are performed, click {\tt GO} and the calculations will begin. Information about the time remaining and percentage of calculations completed will be displayed throughout the calculations. If the calculation needs to be canceled, then click {\tt CANCEL}.  If you decide not to perform a differential expression analysis, then click {\tt DONE}. Once the calculations are completed, a results window will appear, which is described below in Section \ref{sec.results}.

\subsection{Matched Design Studies}

\edge also permits the analysis of matched data for any of the above types of studies. After completing the settings for your respective sampling type (but before clicking {\tt GO} to start the calculations), the user should click on {\tt MATCHED DESIGN SETTINGS}. After the window shown in Figure \ref{fig.diffex-match} appears,  choose the matching variable and click {\tt APPLY}.  Click {\tt CANCEL} to return to the differential expression menu without setting matched design options. As of now, matching is only possible when there are two biological groups (one member of each match per group).  In the time course setting, the individuals must have been sampled at the exact same time points.  It is possible to perform a continuous response analysis with matching because this analysis is a special case of the time course ``within-class'' differential expression significance analysis method.

\subsection{Displaying, Analyzing and Saving Significant Genes} \label{sec.results}

When the significance calculations are complete, the \edge results window will replace the \edge window as in Figure \ref{fig.diffex-results}. The results window will display the genes that are expressed at a certain signficance threshold; the default setting is a q-value cut-off of 10\% but this can easily be changed in the {\tt Select a P or Q Value Cut-off} panel. One can apply a p-value or q-value cut-off, depending on the goals of the user, by checking the appropriate box in this panel. After the adjustments to the settings have been made, click {\tt RECALCULATE} and the new list of significant genes will be displayed.

The q-values are estimated using the methodology presented in \cn{JDS01b} and \cn{ST03b}. The q-value is like the p-value, except designed for false discovery rates: a gene's q-value gives the false discovery rate that is incurred when calling that gene significant. The default settings for estimating the q-values given in the {\tt Optional Q-value Arguments} panel are recommended unless the $\pi_0$ estimation does not appear to be behaving well. The parameter $\pi_0$ is the proportion of genes that are not differentially expressed. It is a key component to estimating the false discovery rate. A manual on q-value estimation is available at \url{http://faculty.washington.edu/jstorey/qvalue}. In fact, the {\tt QVALUE} software is embedded in the \edge software. The user can click {\tt RECALCULATE} after altering the significance parameters to show the new list of genes that meet the redefined threshold or q-value estimation settings. 

To check the q-value estimation and global behavior (which can be helpful for defining a useful significance threshold), the user can click on the {\tt Q-PLOT} button to create a q-plot for analysis of q-values. The first panel in the q-plots gives an indication as to how well the $\pi_0$ is behaving -- see \cn{ST03b} for more on q-plots. Clicking the {\tt P-VALUE HISTOGRAM} button displays a histogram of the p-values. Clicking the {\tt CLUSTER SIGNIFICANT GENES} button will invoke the hierarchical clustering function explained in Section \ref{sec.cluster}, except the clustering is only performed on the significant genes rather than the entire data set.

Any gene in the {\tt Genes Called Significant} window can be queried on PubMed by its gene name.  This is accomplished by highlighting the gene in this window and clicking the {\tt ACCESS PUBMED FOR SELECTED GENE} button. This option will only make sense if the gene names are UIDs or accession numbers. See Section \ref{sec.dataformat} for more on formatting the gene names.

To save the results from the differential expression analysis, click the {\tt SAVE RESULTS} button. The list of gene names, q-values, and p-values will be saved into a tab delimited text file denoted by the user. Only the results shown in the {\tt Differentially Expressed Genes} box will be saved. To save the results for all genes, apply a q-value cut-off of 1 (as explained above) before saving the results. To exit the \edge results menu, clear the current results and return to the differential expression options menu, click the {\tt DONE} button. 

\section{Using the EDGE for Excel Add-In}
\subsection{Introduction}
Microsoft Excel is commonly used for organizing and preprocessing gene expression data. EDGE can be invoked directly from an Excel worksheet, versions 2003 and later, on Windows or Macintosh machines, with the click of a button. This chapter contains instructions for installing and using the Add-In.

\subsection{Installing the Add-In}
The Add-In must be installed by hand from within Excel after the main EDGE application has been installed. To install the Add-In,
\begin{enumerate}
\item Open Excel.
\item From the {\tt Tools} menu, select {\tt Add-Ins}.
\item Click {\tt Browse...} (Windows) or {\tt Select...} (Macintosh)
\item Find the EDGE program directory. On Windows, this is likely {\tt C:$\backslash$Program Files$\backslash$R$\backslash$EDGE}. On Macintosh, this should be {\tt /Applications/EDGE}.
\item In the {\tt excel} subdirectory, select {\tt EdgeModule.xla} and click OK.
\item Make sure the checkbox next to {\tt EDGE for Excel Add-In} is checked.
\item Click {\tt OK}.
\item After you click {\tt OK}, the add-in will install a menu entitled ``EDGE'' and a toolbar button.
\end{enumerate}

\subsection{Using the Add-In}
\begin{enumerate}
\item Open your gene expression data spreadsheet.
\item The Add-In can handle data in most formats as long as all data is contained in the same workbook. However, the Add-In most easily detects covariates and data if they are arranged as follows: Covariates should be listed at the top of a worksheet, followed by a blank row, followed by the expression data. Figure \ref{fig.exceldata} provides an example, and so does the sample spreadsheet brca$\_$example.xls. Of the visible arrays in the figure, 1, 2, and 3 are from individuals with the BRCA1 mutation and 8 and 9 are from individuals with the BRCA2 mutation.
\item Select the area containing the covariates, gene names, and data.
\item From the EDGE menu, select {\tt Analyze with EDGE}. Alternately, select the toolbar button with the same caption.
\item You will see a dialog specifying the range containing covariates, and the cell range containing data. Take a moment to verify the selections. To change the selections, click the button to the right of the range text area.
\item Click Continue. The screen may flicker as the add-in saves temporary files for the covariates and data. EDGE will start and your data will be automatically loaded. Follow the instructions in the rest of this manual to complete your analysis.
\end{enumerate}

\subsection{Removing the Add-In}
To remove the EDGE for Excel Add-In,
\begin{enumerate}
\item Open Excel.
\item From the {\tt Tools} menu, select {\tt Add-Ins}.
\item Uncheck the box next to {\tt EDGE for Excel Add-In}.
\item Click {\tt OK}.
\end{enumerate}
The toolbar button and menu will be removed.

\section{Frequently Asked Questions} 

\begin{enumerate}
\item {\it What are the operating system requirements for \edgens?} \\
\edge is available for Windows, Macintosh OS X, Linux and Unix.
\item {\it \edge won't start up on Mac OS X.  I get an error including the line} ``{\tt Error in edge() : TCLTK support is absent}.'' \\
Check to make sure that you have downloaded and installed X11. 
\item {\it Where can I go for help if I cannot get \edge to work?} \\
First, please visit the \edge google group at \url{http://groups-beta.google.com/group/edge-software} and read the old posts to try to find the answer to your problem. If you still are having difficulty, please post to the group, and include the error message, the operating system and version of {\tt R} you are using. 
\item {\it How do I view the p/q-values for all genes?} \\
In the {\tt Differential Expression Results} menu, choose a p/q-value cutoff of 1 to view all p/q-values. 
\item {\it \edge only prints the first 10 characters of the gene names on the {\tt Differential Expression Results} menu. How can I view the full gene names?} \\
Only the first 10 characters are printed to the differential expression results screen for display purposes. Save the differential expression results to view the full gene names. 
\item {\it How do I cite the \edge software?} \\
See the citations subsection of this document. 
\item {\it Will \edge work on my laptop that was purchased in 1996?} \\
Microarray analyses tend to be computationally intensive, so we recommend using a powerful desktop computer for the most enjoyable \edge experience. 
\end{enumerate}

\section{Getting Further Help}

A Google discussion group has been formed to handle help inquiries and suggestions.  This is the {\it official} mechanism for obtaining support.  If you have a question, please first browse the previous messages to see whether your question has already been addressed.  Membership to the discussion group is free with an email address.  To join, go to
\begin{center}
\url{http://groups.google.com/group/edge-software}
\end{center}
and click on {\tt Join this group}.  During the setup process, you can specify whether you want to be notified by email when new messages are posted.  Note that you can read past messages without being a member.  Membership is only required for posting.

\newpage
\begin{figure}[ht]
\caption{A comparison between \edge and five leading procedures for identifying differentially expression genes applied to the BRCA data set of Section \ref{sec.data}. For each q-value (false discovery rate) cut-off, the number of genes found to be significant is plotted for each procedure. See Storey et al. (2007) for comparisons based on a 3-sample analysis, where improvements are even greater. \label{fig.edgecomp}}
\centerline{\includegraphics[width=\textwidth]{edgecomp.pdf}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Main \edge window. The menu lists the eight possible analysis tasks to perform. The main window remains present for all tasks except for clustering and displaying differential expression results. \label{fig.main}} \medskip
\centerline{\includegraphics[height=8in]{main.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Loading data and saving the set as an {\tt R} object. \label{fig.load}} \medskip
\centerline{\includegraphics[height=8in]{load.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Missing data imputation. \label{fig.impute}} \medskip
\centerline{\includegraphics[height=8in]{impute.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Display covariate data. \label{fig.covariate}} \medskip
\centerline{\includegraphics[height=8in]{covariate.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Transform data. \label{fig.transform}} \medskip
\centerline{\includegraphics[height=8in]{transform.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Display boxplots of data grouped by any covariate or by the order of arrays in the data file. \label{fig.boxplot}} \medskip
\centerline{\includegraphics[height=8in]{boxplot.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{An example of the displayed boxplots. \label{fig.boxplot2}} \medskip
\centerline{\includegraphics[width=\textwidth]{boxplot2.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Perform hierarchical clustering on the entire data set or a subset of differentially expressed genes. \label{fig.cluster}} \medskip
\centerline{\includegraphics[width=\textwidth]{cluster.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{An example of a displayed hierarchical clustering. \label{fig.cluster2}}  \medskip
\centerline{\includegraphics[width=\textwidth]{cluster2.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Perform an ``eigen-analysis'' of the expression data set. \label{fig.eigen}} \medskip
\centerline{\includegraphics[height=8in]{eigen.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{An example of a displayed eigen-genes. \label{fig.eigen2}} \medskip
\centerline{\includegraphics[width=\textwidth]{eigen2.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{The main window for performing an \edge differential expression analysis. \label{fig.diffex}} \medskip
\centerline{\includegraphics[height=8in]{diffex.jpg}}
\end{figure}

%\newpage
%\begin{figure}[p]
%\caption{Static sampling settings. Static sampling refers to the typical, non-time-course sampling. These options are %currently disabled. \label{fig.diffex-static}} \medskip
%\centerline{\includegraphics[height=8in]{diffex-static.jpg}}
%\end{figure}

\newpage
\begin{figure}[p]
\caption{Time course sampling settings. \label{fig.diffex-time}} \medskip
\centerline{\includegraphics[height=8in]{diffex-time.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Settings in the differential expression analysis when there is ``matching'' between arrays. \label{fig.diffex-match}} \medskip
\centerline{\includegraphics[height=8in]{diffex-match.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Display of differential expression results. It is possible to view significance measure information (q-value plots and p-value histogram), access NCBI for any significant gene, or cluster the differentially expressed genes.  Significance cut-offs can be adjusted according to the user's preference. \label{fig.diffex-results}} \medskip
\centerline{\includegraphics[width=\textwidth]{diffex-results.jpg}}
\end{figure}

\newpage
\begin{figure}[p]
\caption{Example of an Excel spreadsheet that is ideally formatted for EDGE. Note the blank row between the covariates and data. \label{fig.exceldata}} \medskip
\centerline{\includegraphics[width=\textwidth]{excelData.png}}
\end{figure}

\newpage \small
\bibliographystyle{dcu2}
\bibliography{refs}


\end{document}





