Skip to content

Commit

Permalink
cscore histogram labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ftwkoopmans committed Feb 27, 2025
1 parent 77cab25 commit 6140cb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/plot_score_distributions.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ plot_dia_cscore_histograms = function(tib_input) {
}

legend_text = sprintf("\n\nCscore: %.3f\n#pep: %d %d%%", target_cscore_min, sum(is_target_qval_filtered), round(sum(is_target_qval_filtered) / length(is_target_qval_filtered) * 100))
xcoord_annotation = max(tib_xlim[1], target_cscore_min, na.rm = TRUE)

# plot
p = ggplot(tib, aes(x = cscore, y = ..density.., fill = type)) +
Expand All @@ -76,7 +77,7 @@ plot_dia_cscore_histograms = function(tib_input) {
}

p = p +
annotate(geom = "text", label = legend_text, x = max(tib_xlim[1], target_cscore_min, na.rm = TRUE), y = Inf, hjust = -0.1, vjust = 0.6, size = 2) +
ggplot2::annotate(geom = "label", x = tib_xlim[2], y = Inf, hjust = 1.1, vjust = 1, label = legend_text, label.size = NA, fill = "white") +
scale_x_continuous(limits = tib_xlim, expand = ggplot2::expansion()) +
labs(x = "", y = "", title = sid, fill = "") +
ggpubr::theme_classic2() +
Expand Down

0 comments on commit 6140cb5

Please sign in to comment.