Creating Mapping from Marker Lists

Description

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

Usage

matchIndex(object, data, ...)

S4 (list,character)
`matchIndex`(object, data, unlist = FALSE, no.match = FALSE, keep.names = TRUE, 
  verbose = FALSE)

Arguments

object
to match against the reference data
data
reference data against which to match the object, i.e. retrieve the indexes from.
...
extra argument to allow extension
unlist
a logical that indicates if the indexes should be returned as a vector (TRUE) or another MarkerList object.
no.match
a logical that specifies if the result should keep the markers that cannot be found in the reference object. If TRUE, 0L values are used for unmatched markers. Default is FALSE.
keep.names
a logical that indicates if the markers' names should be kept or removed (FALSE). In this case, the names of the sets of each markers are used -- and repeated.
verbose
verbosity level, usually TRUE or FALSE.

Methods

  1. matchIndexsignature(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).

  2. matchIndexsignature(object = "list", data = "matrix"): Match markers against the row names of a data matrix.

  3. matchIndexsignature(object = "list", data = "NMF"): Match markers against the basis matrix of an NMF model object.

    See matchIndex,MarkerList,matrix-method.

  4. matchIndexsignature(object = "list", data = "ExpressionSet"): Match markers against the expression matrix of an ExpressionSet data object.

    See matchIndex,MarkerList,matrix-method.

  5. matchIndexsignature(object = "list", data = "ChipDb"): Match markers against the keys of a chip annotation database.

  6. matchIndexsignature(object = "list", data = "ProbeAnnDbBimap"): Match markers against the keys of a probe annotation database.

Examples


# 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