This function calculates the area under the curve (AUC) for pathway scores with respect to a specific cell type. It uses the AUC to evaluate the performance of the pathway scores in distinguishing the target cell type from others.
auc(celltype, pathway.scores, return.mean = TRUE, seed = 1)A factor or character vector representing the cell type labels for each cell.
A matrix of pathway scores where rows represent cells and columns represent different pathways.
Logical, indicating whether to return the weighted mean AUC across all cell types. If FALSE, returns the AUC for each pathway. Default is TRUE.
An integer specifying the random seed for reproducibility. Default is 1.
If return.mean = TRUE, a numeric vector containing the weighted mean AUC. If return.mean = FALSE, a numeric matrix of AUCs where rows represent pathways and columns represent cell types.
AUC for the AUC calculation.