Skip to content

Commit

Permalink
Update Res-DE.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorRDB committed Oct 28, 2020
1 parent b897383 commit e8e1813
Showing 1 changed file with 48 additions and 16 deletions.
64 changes: 48 additions & 16 deletions DE/Res-DE.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,58 @@ suppressMessages(
rm(libs)
```

# Getting the mapping results
# Pancreas

```{r}
df <- bind_rows("Pancreas" = read.csv(here("Mapping", "Data", "Pancreas.csv")),
"Brain" = read.csv(here("Mapping", "Data", "Brain.csv")),
.id = "pair") %>%
pivot_longer(c("imp", "imp_prop"), names_to = "Type", values_to = "proba")
Pancreas <- read.csv(here("DE", "Data", "Pancreas.csv")) %>%
rename("method_1" = "X") %>%
pivot_longer(-method_1, values_to = "Dist", names_to = "method_2") %>%
group_by(method_1, method_2) %>%
mutate(first = min(method_1, method_2),
second = max(method_1, method_2)) %>%
ungroup() %>%
select(first, second, Dist) %>%
distinct() %>%
filter(word(first, 2, sep = "\\.") == word(second, 2, sep = "\\."),
Dist != 1) %>%
mutate(level = word(first, 2, sep = "\\."),
first = word(first, 1, sep = "\\."),
second = word(second, 1, sep = "\\."),
same_dataset = word(first, 1, sep = "_") == word(second, 1, sep = "_"),
same_comp = word(first, 2, sep = "_") == word(second, 2, sep = "_"),
same_method = word(first, 3, sep = "_") == word(second, 3, sep = "_"),
level = if_else(level == "00", "Initial", "Final")) %>%
# filter(same_dataset == TRUE) %>%
pivot_wider(names_from = "level", values_from = "Dist")
ggplot(Pancreas, aes(x = Initial, y = Final, color = same_method)) +
geom_jitter() +
facet_wrap(~same_dataset, scales = "free")
```

```{r}
ggplot(df, aes(x = proba, fill = pair)) +
geom_histogram(position = "dodge", bins = 50) +
my_theme() +
facet_wrap(~Type) +
scale_fill_brewer(type = "qual")
```
# Brain

```{r}
df %>%
group_by(pair, Type) %>%
summarise(imp = mean(proba > 0),
mean_imp = mean(proba))
Brain <- read.csv(here("DE", "Data", "Brain.csv")) %>%
rename("method_1" = "X") %>%
pivot_longer(-method_1, values_to = "Dist", names_to = "method_2") %>%
group_by(method_1, method_2) %>%
mutate(first = min(method_1, method_2),
second = max(method_1, method_2)) %>%
ungroup() %>%
select(first, second, Dist) %>%
distinct() %>%
filter(word(first, 2, sep = "\\.") == word(second, 2, sep = "\\."),
Dist != 1) %>%
mutate(level = word(first, 2, sep = "\\."),
first = word(first, 1, sep = "\\."),
second = word(second, 1, sep = "\\."),
same_dataset = word(first, 1, sep = "_") == word(second, 1, sep = "_"),
same_comp = word(first, 2, sep = "_") == word(second, 2, sep = "_"),
same_method = word(first, 3, sep = "_") == word(second, 3, sep = "_"),
level = if_else(level == "00", "Initial", "Final")) %>%
# filter(same_dataset == TRUE) %>%
pivot_wider(names_from = "level", values_from = "Dist")
ggplot(Pancreas, aes(x = Initial, y = Final, color = same_method)) +
geom_jitter() +
facet_wrap(~same_dataset, scales = "free")
```

0 comments on commit e8e1813

Please sign in to comment.