Subsetting Marker Lists

Description

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.

Usage

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, ...)

Arguments

drop
logical that indicates if one should drop empty cell types before returning the result -- as a MarkerList.
match.names
logical that indicates one should try to match the names of x and i before subsetting/re-ordering.
subset
the reference set in which the markers are looked-up. It can be a character vector, a matrix, or NMF or ExpressionSet objects.
select
a character, integer or logical vector specifying which set/cell-type to keep. If a single string and fixed=FALSE, it is used as a regular expression to match against the set names.
filter
a single integer specifying the maximum number of markers per cell-type
skip
a single integer specifying the number of top markers to skip in each cell type
total
logical that inidicates if argument filter specifies the total number of markers or the maximum number of markers per cell type.
invert
logical used when select that indicates that one selects the set (cell type) that do not satisfy the condition defined by argument select.
fixed
logical used only when select is a single string to specify that it should be interpreted as a regular expression to match against the set names.
ignore.case
logical used only when select is a single string to specify that the match should not be case-sensitive.
verbose
verbosity level, usually TRUE or FALSE.
...
extra arguments passed to convertIDs if necessary.
x
object from which to extract element(s) or in which to replace element(s).
i
indices specifying elements to extract or replace. Indices are 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).
j
indices specifying elements to extract or replace. Indices are 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).

Value

an MarkerList object

Details

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.

Methods

  1. [signature(x = "MarkerList", i = "list", j = "ANY"): This method subsets/reorders each set of marker using a subset specification found in

  2. [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.

  3. subsetsignature(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.