\HeaderA{getRelevantEGenes}{Automatic selection of most relevant effect reporters}{getRelevantEGenes}
\aliasA{filterEGenes}{getRelevantEGenes}{filterEGenes}
\aliasA{selectEGenes}{getRelevantEGenes}{selectEGenes}
\keyword{models}{getRelevantEGenes}
\begin{Description}\relax
1. A-priori filtering of effect reporters/E-genes: Select effect reporters, which show a pattern of differential expression across experiments that is expected to be non-random. 
2. Automated effect reporters subset selection: Select those effect reporters, which have the highest likelihood under the given network hypothesis.
\end{Description}
\begin{Usage}
\begin{verbatim}
filterEGenes(Porig, D, Padj=NULL, ntop=100, fpr=0.05, adjmethod="bonferroni", cutoff=0.05)

getRelevantEGenes(Phi, D, control, nEgenes=min(10*nrow(Phi), nrow(D)))
\end{verbatim}
\end{Usage}
\begin{Arguments}
For method filterEGenes:
\begin{ldescription}
\item[\code{Porig}] matrix of raw p-values, typically from the complete array
\item[\code{D}] data matrix. Columns correspond to the nodes in the silencing scheme. Rows are effect reporters. 
\item[\code{Padj}] matrix of false positive rates. If not, provided Benjamini-Hochbergs method for false positive rate computation is used.
\item[\code{ntop}] number of top genes to consider from each knock-down experiment
\item[\code{fpr}] significance cutoff for the FDR
\item[\code{adjmethod}] adjustment method for pattern p-values
\item[\code{cutoff}] significance cutoff for patterns
\item[\code{Phi}] adjacency matrix with unit main diagonal 
\item[\code{control}] list of parameters: see \code{set.default.parameters}
\item[\code{nEgenes}] no. of E-genes to select
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The method filterEGenes performs an a-priori filtering of the complete microarray. It determines how often E-genes are expected to be differentially expressed across experiments just randomly. According to this only E-genes are chosen, which show a pattern of differential expression more often than can be expected by chance.

The method getRelevantEGenes looks for the E-genes, which have the highest likelihood under the given network hypothesis. In case of the scoring type "CONTmLLBayes" these are all E-genes which have a positive contribution to the total log-likelihood. In case of type "CONTmLLMAP" all E-genes not assigned to the "null" S-gene are returned. This involves the prior probability delta/no. S-genes for leaving out an E-gene.
For all other cases ("CONTmLL", "FULLmLL", "mLL") the nEgenes E-genes with the highest likelihood under the given network hypothesis are returned.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{I}] index of selected E-genes
\item[\code{dat}] subset of original data according to I 
\item[\code{patterns}] significant patterns
\item[\code{nobserved}] no. of cases per observed pattern
\item[\code{selected}] selected E-genes
\item[\code{mLL}] marginal likelihood of a phenotypic hierarchy
\item[\code{pos}] posterior distribution of effect positions in the hierarchy
\item[\code{mappos}] Maximum a posteriori estimate of effect positions
\item[\code{LLperGene}] likelihood per selected E-gene
\end{ldescription}
\end{Value}
\begin{Author}\relax
Holger Froehlich
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{nem}{nem}}, \code{\LinkA{score}{score}}, \code{\LinkA{mLL}{mLL}}, \code{\LinkA{FULLmLL}{FULLmLL}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
   # Drosophila RNAi and Microarray Data from Boutros et al, 2002
   data("BoutrosRNAi2002")
   D <- BoutrosRNAiDiscrete[,9:16]

   # enumerate all possible models for 4 genes
   Sgenes = unique(colnames(D))
   models <- enumerate.models(Sgenes)  
   
   getRelevantEGenes(models[[64]], D, control=set.default.parameters(Sgenes, para=c(.13,.05), type="mLL"))

\end{ExampleCode}
\end{Examples}

