\HeaderA{RangesMatchingList-class}{List of Matchings between Ranges}{RangesMatchingList.Rdash.class}
\aliasA{as.matrix,RangesMatchingList-method}{RangesMatchingList-class}{as.matrix,RangesMatchingList.Rdash.method}
\aliasA{as.table,RangesMatchingList-method}{RangesMatchingList-class}{as.table,RangesMatchingList.Rdash.method}
\aliasA{queryHits,RangesMatchingList-method}{RangesMatchingList-class}{queryHits,RangesMatchingList.Rdash.method}
\aliasA{ranges,RangesMatchingList-method}{RangesMatchingList-class}{ranges,RangesMatchingList.Rdash.method}
\aliasA{space,RangesMatchingList-method}{RangesMatchingList-class}{space,RangesMatchingList.Rdash.method}
\aliasA{subjectHits,RangesMatchingList-method}{RangesMatchingList-class}{subjectHits,RangesMatchingList.Rdash.method}
\aliasA{t,RangesMatchingList-method}{RangesMatchingList-class}{t,RangesMatchingList.Rdash.method}
\keyword{methods}{RangesMatchingList-class}
\keyword{classes}{RangesMatchingList-class}
\begin{Description}\relax
The \code{RangesMatchingList} class stores a set of
matchings, represented as \code{\LinkA{RangesMatching}{RangesMatching.Rdash.class}} objects,
between the ranges in one \code{\LinkA{RangesList}{RangesList.Rdash.class}} object and the
ranges in another.
\end{Description}
\begin{Details}\relax
Roughly the same set of utilities are provided for
\code{RangesMatchingList} as for \code{RangesMatching}:

The \code{as.matrix} method coerces a \code{RangesMatchingList} in a
similar way to \code{RangesMatching}, except a column is prepended
that indicates which space (or element in the query \code{RangesList})
to which the row corresponds.

The \code{as.table} method flattens or unlists the list, counts the
number of matchings for each query range and outputs the counts as a
\code{table}, which has the same shape as from a single \code{RangesMathing}.

To transpose a \code{RangesMatchingList} \code{x}, so that the subject
and query in each space are interchanged, call \code{t(x)}. This
allows, for example, counting the number of subjects that matched
using \code{as.table}.

To get the actual regions of intersection between the overlapping
ranges, use the \code{ranges} accessor.
\end{Details}
\begin{Section}{Coercion}
In the code snippets below, \code{x} is a \code{RangesMatchingList}
object.

\describe{
\item[] \code{as.matrix(x)}: calls \code{as.matrix} on each
\code{RangesMatching}, combines them row-wise and offsets the
indices so that they are aligned with the result of calling
\code{unlist} on the query and subject.

\item[] \code{as.table(x)}: counts the number of matchings for each
query range in \code{x} and outputs the counts as a \code{table},
which is aligned with the result of calling \code{unlist}
on the query.

\item[] \code{t(x)}: Interchange the query and subject in each space
of \code{x}, returns a transposed \code{RangesMatchingList}.
}
\end{Section}
\begin{Section}{Accessors}
\describe{
\item[] \code{queryHits(x)}: Gets the indices of overlapping
ranges in the query, equivalent to \code{as.matrix(x)[,1]}.

\item[] \code{subjectHits(x)}: Gets the indices of overlapping
ranges in the subject, equivalent to \code{as.matrix(x)[,2]}.

\item[] \code{space(x)}: gets the character vector naming the space
in the query \code{RangesList} for each match, or \code{NULL} if the
query did not have any names.

\item[] \code{ranges(x, query, subject)}: returns a \code{RangesList}
holding the intersection of the ranges in the
\code{RangesList} objects \code{query} and \code{subject}, which
should be the same subject and query used to generate
\code{x}. Eventually, we might store the query and subject inside
\code{x}, in which case the arguments would be redundant.

}
\end{Section}
\begin{Note}\relax
This class is highly experimental. It has not been well tested and
may disappear at any time.
\end{Note}
\begin{Author}\relax
Michael Lawrence
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{findOverlaps}{findOverlaps}}, which generates an instance of this class.
\end{SeeAlso}

