Skip to content
Snippets Groups Projects
Commit 17a56f1b authored by Jeffrey Pullin's avatar Jeffrey Pullin
Browse files

Add tSNE plot of null simulations

parent 07b49fa5
No related branches found
No related tags found
No related merge requests found
......@@ -45,9 +45,9 @@ fdr_data <- fdr_pars %>%
unchop(c(sel_mgs, group_id))
```
```{r count-signficant-genes}
```{r n-sig-true-null}
fdr_data %>%
filter(sim_label == "standard_sim") %>%
filter(sim_label == "null_sim") %>%
filter(is.na(test.use) | test.use != "roc") %>%
filter(is.na(pval.type) | pval.type == "all") %>%
rowwise() %>%
......@@ -55,43 +55,66 @@ fdr_data %>%
ungroup() %>%
group_by(pars, rep) %>%
summarise(n_sig = sum(n_sig), .groups = "drop") %>%
mutate(pars = fct_reorder(factor(pars), n_sig)) %>%
group_by(pars) %>%
summarise(n_sig = mean(n_sig), .groups = "drop") %>%
mutate(pars = fct_reorder(factor(pars), n_sig)) %>%
ggplot(aes(pars, y = n_sig)) +
geom_boxplot() +
coord_flip() +
geom_col() +
geom_text(
aes(label = n_sig),
position = position_dodge(0.1),
hjust = -0.5, size = 3,
) +
coord_flip(ylim = c(0, 11000)) +
scale_y_continuous(breaks = seq(0, 10000, by = 2000)) +
labs(
title = "Null simulations",
x = "Method",
y = "Number of significant genes"
) +
theme_bw()
```
```{p-value-histograms}
fdr_data %>%
filter(sim_label == "standard_sim" & rep == 1) %>%
```{r n-sig-standard}
fdr_data %>%
filter(sim_label == "standard_sim") %>%
filter(is.na(test.use) | test.use != "roc") %>%
filter(is.na(pval.type) | pval.type == "all") %>%
rowwise() %>%
mutate(p_value = list(sel_mgs$p_value)) %>%
mutate(n_sig = filter(sel_mgs, p_value_adj < 0.05) %>% nrow()) %>%
ungroup() %>%
unnest(cols = p_value) %>%
ggplot(aes(x = p_value)) +
geom_histogram(bins = 30) +
facet_wrap(~pars) +
group_by(pars, rep) %>%
summarise(n_sig = sum(n_sig), .groups = "drop") %>%
group_by(pars) %>%
summarise(n_sig = mean(n_sig), .groups = "drop") %>%
mutate(pars = fct_reorder(factor(pars), n_sig)) %>%
ggplot(aes(pars, y = n_sig)) +
geom_col() +
geom_text(
aes(label = n_sig),
position = position_dodge(0.1),
hjust = -0.5, size = 3,
) +
coord_flip(ylim = c(0, 24000)) +
scale_y_continuous(breaks = seq(0, 24000, by = 4000)) +
labs(
x = "p value",
y = "Count"
title = "Standard simulations",
x = "Method",
y = "Number of significant genes"
) +
theme_bw()
theme_bw()
```
```{r p-value-histograms}
# With knowledge of the true null.
fdr_data %>%
filter(sim_label == "standard_sim" & rep == 1) %>%
filter(sim_label == "null_sim" & rep == 1 ) %>%
filter(is.na(test.use) | test.use != "roc") %>%
rowwise() %>%
mutate(p_value = list(sel_mgs$p_value)) %>%
mutate(p_value_adj = list(sel_mgs$p_value_adj)) %>%
ungroup() %>%
unnest(cols = p_value) %>%
mutate(p_value = log(p_value + 0.001)) %>%
ggplot(aes(x = p_value)) +
unnest(cols = p_value_adj) %>%
ggplot(aes(x = p_value_adj)) +
geom_histogram(bins = 30) +
facet_wrap(~pars) +
labs(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment