\HeaderA{availableXrefs}{Get cross reference(s) of interactors from PSI-MI 2.5 files}{availableXrefs}
\aliasA{xref}{availableXrefs}{xref}
\keyword{models}{availableXrefs}
\begin{Description}\relax
PSI-MI 2.5 data exchange format encourages data providers to encode
cross referenes of the interactors into the file, which prove valuable
for annotating the data. These functions help finding out the available cross references of
interactors.
\end{Description}
\begin{Usage}
\begin{verbatim}
availableXrefs(x,...)
xref(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] for \code{availableXrefs}, 'x' can either be an object of
\code{\LinkA{psimi25Interactor-class}{psimi25Interactor.Rdash.class}}, 
\code{link\{psimi25InteractionEntry\}} or a list of
\code{\LinkA{psimi25Interactor-class}{psimi25Interactor.Rdash.class}} objects.

for \code{xref}, 'x' should be an object of \code{\LinkA{psimi25Interactor-class}{psimi25Interactor.Rdash.class}}

\item[\code{...}] intersect, logical option. If set to \code{TRUE} then only
the cross references available for every interactor are returned
(intersected), otherwise all the cross references are unioned and
returned. See the examples
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{psimi25InteractionEntry} is provided as the parameter of
\code{availableXrefs}, an option named "intersect" can be set to
extract only those cross references intersected among all the
interactors, namely the ones assigned in every interactor. Please see
the examples.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{xref }] Returns a matrix with two columns: \code{db} (external database
name) and \code{id} (external database index) 
\item[\code{availableXrefs }] A vector of characters, the names of external
databases referenced in the file
\end{ldescription}
\end{Value}
\begin{Author}\relax
Jitao David Zhang
\end{Author}
\begin{Examples}
\begin{ExampleCode}
xmlDir <- system.file("/extdata/psi25files",package="RpsiXML")

hprdxml <- file.path(xmlDir, "hprd_200709_test.xml")
hprdSet <- parsePsimi25Interaction(hprdxml, HPRD.PSIMI25)
hprdInteractors <- interactors(hprdSet)

availableXrefs(hprdSet)
xref(hprdInteractors[[1]])
availableXrefs(hprdInteractors[[1]])
\end{ExampleCode}
\end{Examples}

