\HeaderA{mergeBGMat}{A function that merges two bipartite graph (BG) incidence
matrices into one.}{mergeBGMat}
\keyword{datagen}{mergeBGMat}
\keyword{array}{mergeBGMat}
\begin{Description}\relax
This function takes the union of the row names of mat1 and mat2
for the row names of the aggregate matrix, and takes the union of the
complexes of mat1 and mat2. The resulting matrix is also an incidence
matrix so an entry of unity impiles protein p is a member of complex C.
\end{Description}
\begin{Usage}
\begin{verbatim}
mergeBGMat(mat1, mat2, toBeRm)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{mat1}] The first bipartite graph incidence matrix
\item[\code{mat2}] The second bipartite graph incidence matrix
\item[\code{toBeRm}] A character vector of complexes to be removed
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function takes two bipartite graph matrices and merges them into
one aggregate incidence matrix where informational redundancy is
removed.

The rows of the aggregate matrix is indexed by the union of the
rownames of mat1 and mat2. It is important that the rownames of mat1
and the rownames of mat2 are from the same name set (e.g. for yeast,
only the standard gene names should be used).

The columns will be indexed by different protein complexes. If two
protein complexes are identical, say C-i = K-j, then either C-i or K-j
should be listed in toBeRm argument (given as an argument). When the
matrices are merged, only one of the two will be kept. The vector
toBeRm is generated by calling either \code{\LinkA{runCompareComplex}{runCompareComplex}}
or \code{\LinkA{findSubComp}{findSubComp}}.
\end{Details}
\begin{Value}
An aggregate bipartite graph incidence matrix.
\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")
#merged = mergeBGMat(mipsM, goM, cc$toBeRm)
\end{ExampleCode}
\end{Examples}

