matchIndex match indexes contained in an object
against some other reference data, returning an object
that is interpretable relatively to the reference data,
e.g. retreive the row index of a data matrix contained in
a marker list.
Methods are provided for MarkerList objects to
match against character vectors, matrix,
ExpressionSet-class or NMF
objects, etc..
matchIndex(object, data, ...)
S4 (list,character)
`matchIndex`(object, data, unlist = FALSE, no.match = FALSE, keep.names = TRUE,
verbose = FALSE)
TRUE) or another
MarkerList object.TRUE, 0L values are used for
unmatched markers. Default is FALSE.FALSE).
In this case, the names of the sets of each markers are
used -- and repeated.TRUE or
FALSE.signature(object = "list", data =
"character"): This is the workhorse method for
MarkerList objects, that is eventually called by
all other methods. It matches marker names against names
in a character vector and returns the corresponding sets
of indexes for each marker set (cell type).
signature(object = "list", data =
"matrix"): Match markers against the row names of a data
matrix.
signature(object = "list", data =
"NMF"): Match markers against the basis matrix of an
NMF model object.
See matchIndex,MarkerList,matrix-method.
signature(object = "list", data =
"ExpressionSet"): Match markers against the expression
matrix of an ExpressionSet data object.
See matchIndex,MarkerList,matrix-method.
signature(object = "list", data =
"ChipDb"): Match markers against the keys of a chip
annotation database.
signature(object = "list", data =
"ProbeAnnDbBimap"): Match markers against the keys of a
probe annotation database.
# load IRIS markers and Abbas signatures
m <- cellMarkers('IRIS')
data(Abbas)
summary(m)
## Length Class Mode
## B 121 -none- numeric
## T 94 -none- numeric
## NK 24 -none- numeric
## Dendritic 86 -none- numeric
## Monocyte 103 -none- numeric
## Neutrophil 54 -none- numeric
## Lymphoid 302 -none- numeric
## Myeloid 449 -none- numeric
## Multiple 1037 -none- numeric
ma <- matchIndex(m, Abbas)
summary(ma)
## Length Class Mode
## B 18 -none- numeric
## T 19 -none- numeric
## NK 1 -none- numeric
## Dendritic 20 -none- numeric
## Monocyte 14 -none- numeric
## Neutrophil 12 -none- numeric
## Lymphoid 15 -none- numeric
## Myeloid 10 -none- numeric
## Multiple 12 -none- numeric
# get as a mapping vector
head(matchIndex(m, Abbas, unlist=TRUE))
## 210356_x_at 218949_s_at 219667_s_at 206641_at 217418_x_at 209995_s_at
## 284 85 281 109 282 79
# only set names
head(matchIndex(m, Abbas, unlist=TRUE, keep.names=FALSE))
## B B B B B B
## 284 85 281 109 282 79
# if keeping all one get 0-value indexes
summary(matchIndex(m, Abbas, no.match=TRUE))
## Length Class Mode
## B 121 -none- numeric
## T 94 -none- numeric
## NK 24 -none- numeric
## Dendritic 86 -none- numeric
## Monocyte 103 -none- numeric
## Neutrophil 54 -none- numeric
## Lymphoid 302 -none- numeric
## Myeloid 449 -none- numeric
## Multiple 1037 -none- numeric