ROC Analysis of the CAAH Signature
Related to Figure 6.
ROC analysis evaluates how well the CAAH 10-gene UCell score discriminates treated from control cells across the captopril and Ren1c KO models.
Define the signature
signature_genes <- c("Clu", "Lrp2", "Lamp2", "Col4a2", "Spink1",
"Wfdc2", "Pax8", "Lyz2", "S100a9", "Cdh13")
Load Seurat objects
ren1c_obj <- readRDS("ren1c_obj.rds")
captopril_obj <- readRDS("captopril_obj.rds")
Score the signature with UCell
captopril_obj <- AddModuleScore_UCell(captopril_obj,
features = list(CAAH = signature_genes), assay = "RNA")
ren1c_obj <- AddModuleScore_UCell(ren1c_obj,
features = list(CAAH = signature_genes), assay = "RNA")
UCell adds a CAAH_UCell column to @meta.data.
Compute ROC curves
# Captopril model
capt_meta <- captopril_obj@meta.data
capt_meta$binary_label <- as.integer(capt_meta$condition == "trt")
roc_capt <- roc(capt_meta$binary_label, capt_meta$CAAH_UCell,
direction = "<", quiet = TRUE)
# Ren1cKO model
ren1c_meta <- ren1c_obj@meta.data
ren1c_meta$binary_label <- as.integer(ren1c_meta$genotype == "KO")
roc_ren1c <- roc(ren1c_meta$binary_label, ren1c_meta$CAAH_UCell,
direction = "<", quiet = TRUE)
cat(sprintf("Captopril AUC: %.3f\n", auc(roc_capt)))
cat(sprintf("Ren1cKO AUC: %.3f\n", auc(roc_ren1c)))
Plot ROC curves
Related with Figure 6b (CAAH 10-gene UCell score ROC curves in the captopril and Ren1c KO mouse models).
roc_df_capt <- data.frame(
specificity = roc_capt$specificities,
sensitivity = roc_capt$sensitivities,
model = "Captopril"
)
roc_df_ren1c <- data.frame(
specificity = roc_ren1c$specificities,
sensitivity = roc_ren1c$sensitivities,
model = "Ren1cKO"
)
roc_df <- rbind(roc_df_capt, roc_df_ren1c)
p_roc <- ggplot(roc_df, aes(x = 1 - specificity, y = sensitivity, colour = model)) +
geom_line(linewidth = 1) +
geom_abline(slope = 1, intercept = 0, linetype = "dashed", colour = "grey60") +
scale_colour_manual(values = c("Captopril" = "#d73027", "Ren1cKO" = "#4575b4")) +
labs(x = "1 - Specificity", y = "Sensitivity", colour = NULL) +
theme_classic(base_size = 11)
ggsave(paste0(parent_dir, "CAAH_signature_ROC_", Sys.Date(), ".svg"),
p_roc, width = 120, height = 100, units = "mm", dpi = 300)