quickPerCellQC | R Documentation |
A convenient utility that identifies low-quality cells based on frequently used QC metrics.
quickPerCellQC(x, ...)
## S4 method for signature 'ANY'
quickPerCellQC(
x,
sum.field = "sum",
detected.field = "detected",
sub.fields = NULL,
...,
lib_size = NULL,
n_features = NULL,
percent_subsets = NULL
)
## S4 method for signature 'SummarizedExperiment'
quickPerCellQC(
x,
...,
subsets = NULL,
assay.type = "counts",
other.args = list(),
filter = TRUE
)
x |
A DataFrame containing per-cell QC statistics, as computed by |
... |
For the generic, further arguments to pass to specific methods. For the ANY method, further arguments to pass to For the SummarizedExperiment method, further arguments to pass to the ANY method. |
sum.field |
String specifying the column of |
detected.field |
String specifying the column of |
sub.fields |
Character vector specifying the column(s) of If set to |
lib_size , n_features , percent_subsets |
Soft-deprecated equivalents of the arguments above. |
subsets , assay.type |
Arguments to pass to the |
other.args |
A named list containing other arguments to pass to the |
filter |
Logical scalar indicating whether to filter out low-quality cells from |
For DataFrame x
, this function simply calls perCellQCFilters
.
The latter should be directly used in such cases; DataFrame inputs are soft-deprecated here.
For SummarizedExperiment x
, this function is simply a convenient wrapper around perCellQCMetrics
and perCellQCFilters
.
If filter=FALSE
or x
is a DataFrame, a DataFrame is returned with one row per cell and containing columns of logical vectors.
Each column specifies a reason for why a cell was considered to be low quality,
with the final discard
column indicating whether the cell should be discarded.
If filter=TRUE
, x
is returned with the low-quality cells removed.
QC statistics and filtering information for all remaining cells are stored in the colData
.
Aaron Lun
perCellQCMetrics
, for calculation of these metrics.
perCellQCFilters
, to define filter thresholds based on those metrics.
example_sce <- mockSCE()
filtered_sce <- quickPerCellQC(example_sce, subsets=list(Mito=1:100),
sub.fields=c("subsets_Mito_percent", "altexps_Spikes_percent"))
ncol(filtered_sce)
# Same result as the longer chain of expressions:
stats <- perCellQCMetrics(example_sce, subsets=list(Mito=1:100))
discard <- perCellQCFilters(stats,
sub.fields=c("subsets_Mito_percent", "altexps_Spikes_percent"))
filtered_sce2 <- example_sce[,!discard$discard]
ncol(filtered_sce2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.