Visualize Average Cell Type Abundance by Phenotype Label
Source:R/PhenoAbundancePlot.R
PhenoAbundancePlot.Rd
This function computes the average abundance of each cell type stratified by phenotype labels and visualizes the result using a line plot. Labels are based on prediction scores or user-provided values.
Details
This plot is useful for interpreting how cell type composition differs across predicted phenotypic groups. Input data should contain cell type proportions and prediction scores with associated phenotype labels.
Examples
if (FALSE) { # \dontrun{
cell_type_distribution <- matrix(runif(300), nrow = 100,
dimnames = list(paste0("spot", 1:100), paste0("cell", 1:3)))
pred_score <- data.frame(
pred_score = rnorm(100),
label = sample(c("phenotype+", "phenotype-", "background"), 100, replace = TRUE),
row.names = paste0("spot", 1:100)
)
PhenoAbundancePlot(cell_type_distribution, pred_score)
} # }