\HeaderA{calculatePosteriorAvg}{Calculate the posterior average for indicators of concordant and
discordant differential expression}{calculatePosteriorAvg}
\keyword{manip}{calculatePosteriorAvg}
\begin{Description}\relax
This function calculates the posterior average for indicators of concordant and
discordant differential expression from the saved log files. See details.
\end{Description}
\begin{Usage}
\begin{verbatim}
calculatePosteriorAvg(object, NCONC=2, NDIFF=1)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] Object of class \code{XdeMcmc}
\item[\code{NCONC}] Integer: number of studies for which the gene must be
differentially expressed (in the same direction) to be classified as
concordant differential expression
\item[\code{NDIFF}] Integer: number of studies for which a gene must be
up- or down-regulated to be classified as differentially expressed.
It is the union of concordant and discordant differential expression.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For each iteration,

1.  calculate the sign of delta * Delta

2.  For each gene, compute the number of positive signs (P) and the
number of negative signs (N) (a G x 2 matrix, where G is the number of
genes in common)

3.  for a given gene, the discordant indicator is simply when P * N
is nonzero.

4.  The concordant indicator requires P * N = 0 AND P + N >=
NCONC, where NCONC is specified by the user.

5.  differential expression is simply   | P | + | N |  >= NDIFF.  By
default, NDIFF is 1 but can be user-specified.

The posterior average is then computed from the mean over all MCMC iterations.
\end{Details}
\begin{Value}
A G x 3 matrix.
\end{Value}
\begin{Author}\relax
RS
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{posteriorAvg}{posteriorAvg}}
\end{SeeAlso}

