knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(SLINGtools)
# qc_types <- c("SPL", "TQC", "BQC", "NIST")
# qc_colors <- c("SPL" = "#fcba03", "TQC" = "blue1", "BQC" = "#ff1f1f", "NIST"="green4")
# qc_fill <- c("SPL" = "#fcfba2", "TQC" = "lightblue", "BQC" = "#ff7878", "NIST"="#b0f7b3")
# dd <- mexp@dataset |> 
#   select(RUN_ID, ANALYSIS_ID, FEATURE_NAME, QC_TYPE, Intensity) |> 
#   filter(QC_TYPE %in% qc_types) 
# 
# dd$QC_TYPE <- forcats::fct_relevel(dd$QC_TYPE, qc_types)
# 
# dd <- dd |> 
#   arrange(QC_TYPE) |>
#   filter(FEATURE_NAME == "PC 38:4 (a)") |> 
#   mutate(Value = as.double(ntile(Intensity, n=30))) |> 
#   mutate(RUN_ID = as.double(ntile(RUN_ID, n=30)))
# 
# p <- ggplot(dd , aes(x=RUN_ID, y=Value, color = QC_TYPE,fill = QC_TYPE)) + 
#   #geom_bin_2d(size =10, bins = 10, alpha = .1, linewidth = 0.1)+
#   #geom_hex(size =10, bins = 11, alpha = .2, linewidth = 0.1)+
#   geom_point(data = dd |> filter(QC_TYPE =="SPL"), size =4, alpha = 0.1, stroke=1.1, shape = 21) +
#   ggfx::with_shadow(geom_point(data = dd |> filter(QC_TYPE %in% c("BQC","TQC", "NIST")), aes(x=RUN_ID, y=Value, color = QC_TYPE,fill = QC_TYPE), size =5, alpha = .6, stroke=1.51, shape = 21), x_offset = 3.5, y_offset = 3.5, sigma = 1.2, colour = "#ffb3b3") +
#   scale_color_manual(values = qc_colors) +
#   scale_fill_manual(values = qc_fill) + 
#   theme_void()
# 
# p
# 
# 
# ggsave(p, "test.png")


SLINGhub/SLINGtools documentation built on April 20, 2023, 5:09 a.m.