Computes a probability matrix [cells x cell_types] by combining per-marker logistic scores weighted by separability, with optional negative-marker penalties.
Usage
calculate_soft_scores(
spe,
marker_stats,
lineage_table,
assay_name = "exprs",
neg_strength = 0.8
)Examples
data("cytoGateR_example", package = "cytoGateR")
image_ids <- SummarizedExperiment::colData(cytoGateR_example)$image_name
spe <- cytoGateR_example[, image_ids == image_ids[1L]]
lineage_table <- data.frame(
cell_type = c("Tcell", "Bcell"),
pos_markers = I(list("CD3e", "CD20")),
neg_markers = I(list("CD20", "CD3e"))
)
marker_stats <- fit_marker_stats(
spe,
markers = c("CD3e", "CD20")
)
prob_mat <- calculate_soft_scores(spe, marker_stats, lineage_table)
head(prob_mat)
#> Tcell Bcell
#> 12_1 0.5394588 0.1215231
#> 12_2 0.1373520 0.5490480
#> 12_3 0.2033158 0.2125928
#> 12_4 0.3452805 0.1698231
#> 12_5 0.3092261 0.1793191
#> 12_6 0.7137936 0.0746164
