Select Markers Based on Scores

Description

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

Usage

selectMarkers(x, ..., .object = NULL)

S3 (MarkerList)
`selectMarkers`(x, threshold = NA, decreasing = FALSE, ..., .object)

S3 (markerScore)
`selectMarkers`(x, statistic = 2L, data = attr(x, "types"), ..., .object)

Arguments

x
data object based on which the markers are selected, as computed returned by extractMarkers(..., format='raw'). The type of x depends on the scoring method used to compute it.
.object
argument used internally by extractMarkers to pass the original object on which marker scores where computed.
threshold
threshold that is applied to filter markers based on their respective statistic/score: Genes with 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.
decreasing
logical that indicates how the statistic/score should be ordered: 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.
statistic
name or column index of the statistic/score to use. The default is to use the second column of the matrix returned by the scoring method, but each method can define its own default.
...
other parameters passed to the scoring method in extractMarkers and selectMarkers, or that define default arguments when defining a scoring method with markerScoreMethod.
data
main extra data used by the scoring and selection methods. If object is a matrix-like object, data is generally a factor or grouping variable, as a vector, that defines the cell-type for each -- pure -- sample. If a vector, this argument is converted into a factor with the levels in their order of appearance in 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.

Value

selectMarkers returns an object of class MarkerList.

Details

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.