Skip to content

Commit

Permalink
Merge pull request #40 from hancockinformatics/fix_size_scale_plot
Browse files Browse the repository at this point in the history
Updated dot size scaling plot
  • Loading branch information
travis-m-blimkie authored Mar 25, 2024
2 parents e3614a8 + a2c2735 commit 98baa2b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ABCindex
Title: A Shiny app to calculate ABCI for checkerboard assays
Version: 0.99.73
Version: 0.99.75
Authors@R:
person(given = "Travis",
family = "Blimkie",
Expand Down
41 changes: 41 additions & 0 deletions _colours.R → _helpers.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Load packages -----------------------------------------------------------

library(dplyr)
library(ggplot2)


# Standard palettes -------------------------------------------------------
Expand Down Expand Up @@ -52,3 +55,41 @@ preset_palettes_split <- list(
)

saveRDS(preset_palettes_split, "data/preset_palettes_split.Rds")


# Dot size scaling plot ---------------------------------------------------

N1S2 <- readRDS("data/size_mapping_N1S2.Rds") %>%
mutate(`Linear Scale` = seq(0, 100)) %>%
rename("ABCindex" = N1S2) %>%
tidyr::pivot_longer(-reference, names_to = "type", values_to = "dot_size") %>%
mutate(type = factor(type, c("Linear Scale", "ABCindex")))

ggplot(N1S2, aes(reference, dot_size, group = type, colour = type)) +
geom_line(linewidth = 2) +
scale_colour_manual(values = c("ABCindex" = "#00c000", "Linear Scale" = "#a00000")) +
labs(
x = "% Biomass reduction",
y = "Dot size",
colour = NULL,
title = "Dot plot scaling",
subtitle = "ABCindex"
) +
scale_x_continuous(
breaks = seq(0, 100, 20),
expand = expansion(mult = c(0, 0.02))
) +
scale_y_continuous(
breaks = seq(0, 100, 20),
expand = expansion(mult = c(0, 0.02))
) +
theme(
title = element_text(face = "bold"),
plot.subtitle = element_text(face = "plain"),
legend.text.align = 0,
legend.position = c(0.79, 0.2),
legend.background = element_blank(),
legend.key.width = unit(12, "mm"),
legend.key.height = unit(9, "mm")
)
ggsave(width = 7, height = (7 * 0.85), "www/help/dot_size_scaling.png", dpi = 300)
Binary file modified www/help/dot_size_scaling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion www/help/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ <h2 class="accordion-header">
</p>
<p>
Below, you can see the exact relationship between the percentage
of biofilm killed and the default dot size used by ABCindex.
of biomass killed and the default dot size used by ABCindex.
</p>
<img src="help/dot_size_scaling.png" alt="Dot size scaling" class="center img-fluid" style="width:50%">
</div>
Expand Down

0 comments on commit 98baa2b

Please sign in to comment.