List of Hits objects
The HitsList class stores a set of Hits objects. It's typically
used to represent the result of
two RangesList objects.
Roughly the same set of utilities are provided for HitsList as for Hits:
as.matrix method coerces a HitsList object in a
similar way to Hits, except a column is prepended that indicates
which space (or element in the query RangesList)
to which the row corresponds.
as.table method flattens or unlists the list, counts the
number of hits for each query range and outputs the counts as a
table, which has the same shape as from a single Hits
To transpose a HitsList object
x, so that the subject
and query in each space are interchanged, call
allows, for example, counting the number of hits for each subject
queryHits(x): Equivalent to
subjectHits(x): Equivalent to
space(x): gets the character vector naming the space in the query RangesList for each hit, or
NULLif the query did not have any names.
In the code snippets below,
x is a HitsList object.
as.matrixon each Hits, combines them row-wise and offsets the indices so that they are aligned with the result of calling
unliston the query and subject.
as.table(x): counts the number of hits for each query element in
xand outputs the counts as a
table, which is aligned with the result of calling
unliston the query.
t(x): Interchange the query and subject in each space of
x, returns a transposed HitsList object.
This class is highly experimental. It has not been well tested and may disappear at any time.
findOverlapsin the IRanges package, which returns a HitsList object when the query and subject are RangesList objects.