auc | R Documentation |
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)
celltype |
A factor or character vector representing the cell type labels for each cell. |
pathway.scores |
A matrix of pathway scores where rows represent cells and columns represent different pathways. |
return.mean |
Logical, indicating whether to return the weighted mean AUC across all cell types. If |
seed |
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.
# Example usage:
celltype <- factor(rep(letters[1:5], each = 20))
pathway.scores <- matrix(runif(1000), nrow = 100, ncol = 10)
colnames(pathway.scores) <- letters[1:10]
auc_values <- auc(celltype, pathway.scores, return.mean = TRUE)
print(auc_values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.