\HeaderA{twoWayTable}{Generate two-way table for genetic interaction data}{twoWayTable}
\keyword{methods}{twoWayTable}
\begin{Description}\relax
Generate two-way table from a vector of genetic interaction status and
a vector of the pairs that share a functional domain.
\end{Description}
\begin{Usage}
\begin{verbatim}
twoWayTable(var1, var2idx)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{var1}] Vector of the status of the first property. 
\item[\code{var2idx}] Vector of the index in \code{var1} that have the
second property. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Calculates the count numbers from the given vectors. Then put them
into a matrix format.
\end{Details}
\begin{Value}
A two-way contingency table of genetic interaction and whether sharing
a functional domain.
\end{Value}
\begin{Author}\relax
Z. Jiang
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{sharedBy}{sharedBy}}, \code{\LinkA{getUniquePairs}{getUniquePairs}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
var1 <- c(0,1,1,0,0,0,1,0,1,1)
var2idx <- c(3,5,7)
twoWayTable(var1,var2idx)

data("AtongFnDomain")
pf <- Biobase::reverseSplit(AtongFnDomain$SharedPfam)
idx <- which(rownames(AtongFnDomain$pairs) %in% pf$PF00478)
twoWayTable(AtongFnDomain$pairs[,"interact"],idx)
\end{ExampleCode}
\end{Examples}

