From e0640878f93ba7730fc93e465a874696b2527f36 Mon Sep 17 00:00:00 2001 From: Andrea Guarracino <62253982+AndreaGuarracino@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:46:57 -0600 Subject: [PATCH] Update plottpr.r to make easy to compare strinct and lenient performance --- cosigt_smk/workflow/scripts/plottpr.r | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cosigt_smk/workflow/scripts/plottpr.r b/cosigt_smk/workflow/scripts/plottpr.r index 1da2f06..bc83a3f 100644 --- a/cosigt_smk/workflow/scripts/plottpr.r +++ b/cosigt_smk/workflow/scripts/plottpr.r @@ -102,15 +102,15 @@ tpr_df <- rbindlist(tpr_list) tpr_df$measure <- factor(tpr_df$measure, levels = c("fn", "tp")) tpr_df$category <- factor(tpr_df$category, levels = c("strict", "lenient")) -p <- ggplot(tpr_df, aes(x = region, y = score, fill = measure)) + +p <- ggplot(tpr_df, aes(x = category, y = score, fill = measure)) + geom_bar(position = "fill", stat = "identity", width = 0.1) + scale_y_continuous(labels = percent_format()) + theme_bw() + - theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) + + theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1), legend.position = "top") + scale_fill_manual(values = c("tp" = "darkred", "fn" = "darkblue")) + - facet_wrap(~category) + + facet_wrap(~region, ncol = 6) + ylab("% score") + xlab("region") ggsave(args[3], width = 20) -fwrite(tpr_df, gsub("pdf", "tsv", args[3]),col.names=T, row.names=F, sep="\t") \ No newline at end of file +fwrite(tpr_df, gsub("pdf", "tsv", args[3]),col.names=T, row.names=F, sep="\t")