Remove, or flag wells that are outliers in discrete or continuous space.
filter(sc, groups = NULL, filt_control = NULL, apply_filter = TRUE) burdenOfFiltering(sc, groups, byGroup = FALSE, filt_control = NULL)
SingleCellAssay
objectcharacter
naming the grouping variablelist
with configuration parameters for the filter.logical
should the filter be applied, or should a matrix of booleans giving if a well would be subject to a filtering criteria be returned?burdenOfFiltering
should the filter be stratified by groups, or only the plotting.A filtered result
The function filters wells that don't pass filtering criteria described in filt_control.
filt_control is a list with named elements nOutlier
(minimum nmber of outlier cells for a cell to be filtered [default = 2]
sigmaContinuous
(the z-score outlier threshold for the continuous part of the signal) [default = 7]
and sigmaProportion
(the z-score outlier threshold for the discrete part of the signal) [default = 7].
If groups
is provided, the filtering is calculated within each level of the group, then combined again as output.
burdenOfFiltering
: plot the proportions of wells are filtered due to different criteria
burdenOfFiltering
data(vbetaFA) ## Split by 'ncells', apply to each component, then recombine vbeta.filtered <- filter(vbetaFA, groups='ncells') ## Returned as boolean matrix was.filtered <- filter(vbetaFA, apply_filter=FALSE) ## Wells filtered for being discrete outliers head(subset(was.filtered, pctout))#> intout null pctout #> Sub01 1 D05 FALSE TRUE TRUE #> Sub01 1 D06 FALSE TRUE TRUE #> Sub01 1 D07 FALSE TRUE TRUE #> Sub01 1 D08 FALSE TRUE TRUE #> Sub01 1 D10 FALSE TRUE TRUE #> Sub01 1 D11 FALSE TRUE TRUEburdenOfFiltering(vbetaFA, groups='ncells', byGroup=TRUE)burdenOfFiltering(vbetaFA, groups='ncells')