Skip to contents

Aggregate Profile Probabilities by Cluster

Usage

cluster_profile_mass(cell_profile_prob, cluster_label)

Arguments

cell_profile_prob

A numeric matrix of profile probabilities (cells × profiles).

cluster_label

A vector of cluster identities (length must match number of rows in `cell_profile_prob`).

Value

A numeric matrix where rows represent clusters and columns represent profile sums.

Details

Computes the total probability mass for each profile across a set of clusters. Typically used to summarize soft profile assignments (e.g., from Clonotrace) across transcriptional clusters.

Examples

set.seed(1)
prob <- matrix(runif(500), nrow = 100, ncol = 5)
prob <- prob / rowSums(prob)
cluster <- sample(letters[1:4], 100, replace = TRUE)
profile_mass <- cluster_profile_mass(prob, cluster)
#> Error in cluster_profile_mass(prob, cluster): could not find function "cluster_profile_mass"
print(profile_mass)
#> Error in print(profile_mass): object 'profile_mass' not found