\HeaderA{runCompareComplex}{A function that calls all other types of comparison functions}{runCompareComplex}
\keyword{datagen}{runCompareComplex}
\begin{Description}\relax
This function begins by acquiring the same vertex set for both BGMat1
and BGMat2. Then it calls the \code{\LinkA{compareComplex}{compareComplex}} function to
calculate three statistics (see \code{\LinkA{compareComplex}{compareComplex}} man page
for details). Next it calls calculates a similarity measure (default
is Jaccard). Next it calls the \code{\LinkA{runAlignment}{runAlignment}} function to
greedily calculate an alignment between BGMat1 and BGMat2.
\end{Description}
\begin{Usage}
\begin{verbatim}
runCompareComplex(BGMat1, BGMat2, index = "Jaccard", byWhich)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{BGMat1}] The first bipartite graph matrix
\item[\code{BGMat2}] The second bipartite graph matrix
\item[\code{index}] The type of similarity index used
\item[\code{byWhich}] A parameter for the maximizeSimilarity
function. It can either be "ROW", "COL", or "BOTH"
\end{ldescription}
\end{Arguments}
\begin{Value}
The return value of runCompareComplex is a list with the
following statistics:

\begin{ldescription}
\item[\code{simInd}] The matrix of similarity measures between two bipartite
graphs.
\item[\code{maxIntersect}] The output of maximizeSimilarity. A list. The
first value is the largest similarity indices between complexes of
the row and complexes of the columns if byWhich is "ROW" and vice
versa if byWhich="COL". The second value returns the actual complex
of highest similarity (column complexes if byWhich="ROW" and row
complexes if byWhich="COL"
\item[\code{equal}] A list of complexes of BGMat1 equal to complexes of
BGMat2. The values of the list are the complex, C, of BGMat1, the
complex, K,  of BGMat2, the cardinality of C, the cardinality of K,
and the cardinality of the intersection of C and K
\item[\code{toBeRm}] A character vector of complexes that should be removed
if two bipartite graphs are merged since they would represent
redundant complexes. If the function is called on one bi-partite
graph, then this vector looks for redundancies within one database
and those complexes needs to be removed as well.  These complexes
are derived from BGMat1 only.
\item[\code{subcomplex}] A list of complexes of BGMat1 which is contained in
complexes of BGMat2 or vice versa. The values of the list are the
complex, C, of BGMat1, the complex, K,  of BGMat2, the cardinality
of C, the cardinality of K, and the cardinality of the intersection
of C and K
\item[\code{toBeRmSubC}] A character vector. The same as toBeRm but instead
of redundant protein complexes, this is a compilation of all the
sub-complexes between two bi-partite graph matrices (bi-partite graph
matrices need not be different)
\end{ldescription}
\end{Value}
\begin{Author}\relax
Tony Chiang
\end{Author}
\begin{Examples}
\begin{ExampleCode}
#go = getGOInfo()
#mips = getMipsInfo()
#goM = createGOMatrix(go)
#mipsM = createMipsMatrix(mips)
#cc = runCompareComplex(mipsM, goM, byWhich = "ROW")
\end{ExampleCode}
\end{Examples}

