Skip to content

Commit

Permalink
Merge pull request #17 from AndreaGuarracino/patch-2
Browse files Browse the repository at this point in the history
Update plottpr.r to make easy to compare strinct and lenient performance
  • Loading branch information
davidebolo1993 authored Jan 8, 2025
2 parents dee91a4 + e064087 commit 47bc577
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cosigt_smk/workflow/scripts/plottpr.r
Original file line number Diff line number Diff line change
Expand Up @@ -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")
fwrite(tpr_df, gsub("pdf", "tsv", args[3]),col.names=T, row.names=F, sep="\t")

0 comments on commit 47bc577

Please sign in to comment.