
Assign broad labels based on the median rank of validated markers
Source:R/method-L2_cluster_enrichment.R
label_broad_clusters.RdAssigns broad cluster labels using ranked marker tables produced by rank_cluster_markers.
Usage
label_broad_clusters(
sce,
broad_config = NULL,
marker_config_key = "marker_config",
ranked_markers = NULL,
ranked_markers_key = "broad_cluster_markers",
cluster_col = "cluster_broad_hvg",
label_col = "broad_cluster",
fdr_threshold = 0.05,
effect_threshold = 0.6,
unassigned_label = "other"
)Arguments
- sce
- broad_config
Named list or
NULL. Validated broad marker definitions as produced bybuild_broad_marker_config. IfNULL, extracted frommetadata(sce)[[marker_config_key]][["broad"]].- marker_config_key
Character scalar. Metadata key containing the marker configuration. Only used when
broad_config = NULL. Defaults to"marker_config".- ranked_markers
List or
NULL. Ranked marker result fromrank_cluster_markers(return_list = TRUE). IfNULL, extracted frommetadata(sce)[[ranked_markers_key]].- ranked_markers_key
Character scalar. Metadata key containing ranked marker tables. Only used when
ranked_markers = NULL. Defaults to"broad_cluster_markers".- cluster_col
Character scalar.
colDatacolumn containing cluster identifiers. Defaults to"cluster_broad_hvg".- label_col
Character scalar. Name of the output
colDatacolumn. Defaults to"broad_cluster".- fdr_threshold
Numeric scalar. Maximum FDR for a marker to be considered significant. Defaults to
0.05.- effect_threshold
Numeric scalar. Minimum effect size (AUC for Wilcoxon, logFC for t-test). Defaults to
0.6.- unassigned_label
Character scalar. Label assigned to clusters with no passing markers. Defaults to
"other".
Details
Ranked marker tables may be supplied either:
directly via the
ranked_markersargument, orindirectly via
metadata(sce)[[ranked_markers_key]].
Broad marker definitions may be supplied either:
directly via the
broad_configargument, orindirectly via
metadata(sce)[[marker_config_key]][["broad"]].
For each cluster, genes are ordered by ascending FDR then descending
effect size (summary.AUC for Wilcoxon, summary.logFC for
t-tests). Within each broad category, only markers passing both
FDR <= fdr_threshold and effect size >= effect_threshold are
retained. The category score is the median rank of passing markers; the
best category is chosen by lowest median rank with user-supplied
priority as a tie-breaker.