MarkerList
objects have convenient subset methods,
that allow to subset the list not only along the sets
(first dimension) but also along the markers, which
proves to be very useful to subset markers list based on
another set of identifier, e.g., the genes present in
some expression data, or in another marker list.
The method `[`
works performs basic strict subsets
using integer, character and logical subsetting vectors.
S4 (MarkerList,ANY,ANY) `[`(x, i, j, ..., drop = FALSE) S4 (MarkerList,list,ANY) `[`(x, i, j, ..., match.names = TRUE, drop = FALSE) S4 (MarkerList,missing,list) `[`(x, i, j, ..., drop = FALSE) S4 (MarkerList) `subset`(x, subset, select, filter = NULL, skip = 0, total = FALSE, invert = FALSE, fixed = TRUE, ignore.case = FALSE, verbose = FALSE, ...)
MarkerList
.x
and i
before
subsetting/re-ordering.NMF
or ExpressionSet
objects.fixed=FALSE
, it is used as a regular
expression to match against the set names.select
that
indicates that one selects the set (cell type) that do
not satisfy the condition defined by argument
select
.select
is a
single string to specify that it should be interpreted as
a regular expression to match against the set names.select
is a single string to specify that the match should
not be case-sensitive.TRUE
or
FALSE
.convertIDs
if necessary.numeric
or character
vectors or empty (missing) or NULL
. Numeric
values are coerced to integer as by
as.integer
(and hence truncated towards
zero). Character vectors will be matched to the
names
of the object (or for
matrices/arrays, the dimnames
): see
Character indices below for further details.
For [
-indexing only: i
, j
,
...
can be logical vectors, indicating
elements/slices to select. Such vectors are recycled if
necessary to match the corresponding extent. i
,
j
, ...
can also be negative integers,
indicating elements/slices to leave out of the selection.
When indexing arrays by [
a single argument
i
can be a matrix with as many columns as there
are dimensions of x
; the result is then a vector
with elements corresponding to the sets of indices in
each row of i
.
An index value of NULL
is treated as if it were
integer(0)
. numeric
or character
vectors or empty (missing) or NULL
. Numeric
values are coerced to integer as by
as.integer
(and hence truncated towards
zero). Character vectors will be matched to the
names
of the object (or for
matrices/arrays, the dimnames
): see
Character indices below for further details.
For [
-indexing only: i
, j
,
...
can be logical vectors, indicating
elements/slices to select. Such vectors are recycled if
necessary to match the corresponding extent. i
,
j
, ...
can also be negative integers,
indicating elements/slices to leave out of the selection.
When indexing arrays by [
a single argument
i
can be a matrix with as many columns as there
are dimensions of x
; the result is then a vector
with elements corresponding to the sets of indices in
each row of i
.
An index value of NULL
is treated as if it were
integer(0)
. an MarkerList
object
For `[`
, argument i
must be a
valid indexes, i.e. a character vector
containing only strings that match exactly some names of
x
, or an integer with indexes in the range of the
length of x
, or a logical vector not longer than
x
.
The second argument j
is allowed not to match
exactly, and may be used to subset the list against
another set of identifiers, or limit each set to the top
first markers.
signature(x = "MarkerList", i = "list", j
= "ANY")
: This method subsets/reorders each set of
marker using a subset specification found in
signature(x = "MarkerList", i = "missing",
j = "list")
: This method is equivalent to x[i, ,
..., match.names=FALSE]
, i.e. that each element of the
marker list x
are subset/reordered as its
corresponding one in j
, following the lists' order
-- with no attempt to match their elements names before
subsetting.
signature(x = "MarkerList")
:
subset
subset a MarkerList
object keeping
only the markers that are present with a given reference
set, which can be a character vector, the rownames of a
matrix or an NMF
object, or the feature names of
an ExpressionSet
. The markers are matched using
the function matchIndex
, and gene identifier
conversion is performed if necessary.