The function selectMarkers
filters raw results
returned by scoring methods and wrap them into a
MarkerList
object. It is called by
extractMarkers
when format is not
'raw'
.
selectMarkers(x, ..., .object = NULL) S3 (MarkerList) `selectMarkers`(x, threshold = NA, decreasing = FALSE, ..., .object) S3 (markerScore) `selectMarkers`(x, statistic = 2L, data = attr(x, "types"), ..., .object)
extractMarkers(..., format='raw')
. The type of
x
depends on the scoring method used to compute
it.extractMarkers
to pass the original object
on which marker scores where computed.statistic >= threshold
are selected if
decreasing=TRUE
. Otherwise, if
decreasing=FALSE
or NA
, the selected genes
are those with statistic <= threshold
.
Filtering is disabled if threshold=NA
.TRUE
orders by
decreasing value (i.e. the greater the score the better),
while FALSE
orders by increasing value (i.e. the
lower the score the better). The value of this argument
also affects the way the filtering is performed (see
argument threshold
).
Ordering is disabled if decreasing=NA
.extractMarkers
and
selectMarkers
, or that define default
arguments when defining a scoring method with
markerScoreMethod
.data
,
by factor(data, levels=unique(data))
. This is to
obtain levels in an order that is consistent with the
samples' order.
If object is a MarkerList
object, then
data is generally a matrix-like object that
contains expression data.selectMarkers
returns an object of class
MarkerList
.
The default method selectMarkers.markerScore
selects markers based on scores stored as a matrix-like
object, whose first column contains a factor or a vector
that assigns each feature to a group (cell type) and
column with index statistic
(by default the second
column) contains the feature scores.
Scoring methods that do not define a dedicated
selectMarkers
must return a MarkerList
object or a matrix that complies with the description
above. It is recommended that, if such methods compute a
range of statistics, they store the requested selection
statistic in the second column.