-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_all_correlations.Rmd
41 lines (33 loc) · 1.14 KB
/
get_all_correlations.Rmd
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
39
40
---
title: "Generate Whole Network"
output: html_notebook
---
```{r}
library(tidyverse)
library(here)
library(propagate)
library(extrafont)
loadfonts()
depmap_data <- read_csv(here('networks', 'depmap', 'avana-public-tentative-19q4_v2-gene-effect.csv'))
```
```{r}
depmap_scores <- depmap_data[,-1]
correlations <- bigcor(depmap_scores, fun = 'cor', use = 'pairwise.complete.obs')
```
```{r}
unblocked_correlations <- correlations[1:nrow(correlations),1:ncol(correlations)]
all_correlations <- unblocked_correlations[upper.tri(unblocked_correlations)]
correlation_tibble <- tibble(correlation = all_correlations)
sum(abs(all_correlations) > 0.2)/length(all_correlations)*100
```
```{r}
# We should probably take a subset before making this figure
ggplot(correlation_tibble) +
aes(x=correlation) +
geom_histogram(binwidth = 0.05, color = 'black', fill = 'skyblue') +
theme_classic() +
theme(text = element_text(size = 10, family = 'Arial'), aspect.ratio = 1) +
geom_vline(xintercept = 0.2, linetype = 'dashed') +
geom_vline(xintercept = -0.2, linetype = 'dashed')
ggsave(here('manuscript_figures', 'all_correlations.pdf'), width = 5, height = 5)
```