\HeaderA{infer.edge.type}{Infer regulation direction for each edge}{infer.edge.type}
\keyword{models}{infer.edge.type}
\begin{Description}\relax
The method infers edge types (up-regulation, down-regulation) for a given nem model. For an edge a-\textgreater{}b the method looks at the fraction of E-genes attached to b (including b itself), which are up- or down-regulated in a knock-down of a. If significantly more genes are down-regulated than up-regulated, the edge a-\textgreater{}b is assumed to be an activation. Likewise, if significantly more genes are up-regulated than down-regulated, a-\textgreater{}b is assumed to be an inhibition. If there is no significant difference in up- and down-regulated edges, a-\textgreater{}b does not have a specified type.
\end{Description}
\begin{Usage}
\begin{verbatim}
infer.edge.type(x, logFC, alpha=0.05, adj.method="BY")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] nem object
\item[\code{logFC}] matrix with fold changes. The rownames of this matrix should correspond to the rownames of the data matrix, which was used to infer the nem model.
\item[\code{alpha}] p-value cutoff
\item[\code{adj.method}] multiple testing correction method. Default: Benjamini-Yekutieli
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Significance is calculated using a two-tailed binomial test with null hypothesis p=0.5.
\end{Details}
\begin{Value}
Modified nem object. Each edge in the nem graph now has a "weight" and a "label" attribute. The label attribute corresponds to the original value in the adjacency matrix. The weight attribute encodes up- and down-regulation in the following way: value 2 means up-regulation, value -1 down-regulation and value 1 corresponds to an unknown regulation type.
\end{Value}
\begin{Author}\relax
Holger Froehlich
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{binom.test}{binom.test}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
        data("BoutrosRNAi2002") 
        D <- BoutrosRNAiDiscrete[,9:16]         
        result = nem(D, control=set.default.parameters(unique(colnames(D)), para=c(0.13,0.05)))
        resEdgeInf = infer.edge.type(result, BoutrosRNAiLogFC)
        plot.nem(resEdgeInf)
\end{ExampleCode}
\end{Examples}

