summaryrefslogtreecommitdiff
path: root/scripts/assay_ranges.R
blob: df520833bf1509385944a86b0f38b17e86abeaaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
library(tidyverse)
library(ggpubr)

data <- read_csv("../csv/data_per_assay_per_year_per_outcome.csv")

tbl <- data %>%
    mutate(
        assay_type = factor(assay, labels = (
            c(
                "MSD (Arb. Intensity)",
                "Multiplex cytokine (log2 Z-score)",
                "Cell Cytometry (% parent popul.)",
                "Multiplex cytokine (log2 Z-score)",
                "Phospho cytometry (flow cytometery,\n 90 %tile fold-change)",
                "Cell Cytometry (% parent popul.)",
                "Phospho cytometry (Mass cytometry, arcsinh diff.)",
                "Complete blood count (abs. count/uL)",
                "MSD (Arb. Intensity)",
                "Cell Cytometry (% parent popul.)",
                "MSD (Arb. Intensity)",
                "Multiplex cytokine (log2 Z-score)",
                "Multiplex cytokine (log2 Z-score)",
                "Cell Cytometry (% parent popul.)"
            )
        ))
    ) %>%
    filter(
           !(assay_type=="Phospho cytometry (flow cytometery,\n 90 %tile fold-change)"
           &
            data > 10000)
    )
plt <- tbl %>%
    ggplot(aes(data, fill=assay_type)) +
    geom_histogram(show.legend=F) +
    facet_wrap(~ factor(assay_type), scales="free") +
    theme_pubclean()
plt
ggsave("../images/assay_value_distributions.png", plt, width = 2 * 15, height = 19, units = "cm")