-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathggseg_script.R
87 lines (60 loc) · 2.92 KB
/
ggseg_script.R
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
library(ggseg)
library(ggseg3d)
library(ggsegExtra)
library(dplyr)
library(tidyr)
library(ggplot2)
library(cowplot)
#Cortical effects
cnr1 <- read.csv ("atlas_dk_cnr1.csv")
cnr2 <- read.csv ("atlas_dk_cnr2.csv")
cnresz <- read.csv ("atlas_dk_esz.csv")
p_cnr1 <- ggseg(.data=cnr1, atlas=dk, colour="white", mapping=aes(fill=vari)) +
labs(fill="CNR1 density") +
theme(legend.position = "right", legend.direction="vertical", legend.margin = margin(0, 0, 0, 0)) +
scale_fill_gradientn(colours = c("royalblue","firebrick","goldenrod"),na.value="black")
p_cnr2 <- ggseg(.data=cnr2, atlas=dk, colour="white", mapping=aes(fill=vari)) +
labs(fill="CNR2 density") +
theme(legend.position = "right", legend.direction="vertical", legend.margin = margin(0, 0, 0, 0)) +
scale_fill_gradientn(colours = c("royalblue","firebrick","goldenrod"),na.value="black")
cnresz= cnresz %>%
group_by (Direction)
p_esz <- ggseg(.data= cnresz, atlas=dk, colour= "white", mapping=aes(fill=vari)) +
labs(fill="Hedge's g") +
facet_wrap(~Direction, ncol=1) +
theme(legend.position = "right", legend.direction="vertical", legend.margin = margin(0, 0, 0, 0)) +
scale_fill_gradientn(colours = c("royalblue","firebrick","goldenrod"),na.value="grey")
cowplot::plot_grid(p_cnr1, p_cnr2, p_esz, ncol =1,
labels = c("A", "B", "C"),
align = "v", axis = "1")
p_cnr1
p_cnr2
p_esz
#Sub-cortical effects
cnr1_2 <- read.csv ("atlas_dk_2_cnr1.csv")
cnr2_2 <- read.csv ("atlas_dk_2_cnr2.csv")
cnresz_2 <- read.csv ("atlas_dk_2_esz.csv")
p_cnr1_2 <- ggseg(.data= cnr1_2, atlas="aseg",
mapping=aes(fill=vari)) +
labs(fill="CNR1 density") +
theme(text = element_text(size=18), legend.position = "right", legend.direction="vertical", legend.margin = margin(0, 0, 0, 0)) +
scale_fill_gradientn(colours = c("royalblue","firebrick","goldenrod"),na.value="grey")
p_cnr2_2 <- ggseg(.data= cnr2_2, atlas="aseg",
mapping=aes(fill=vari)) +
labs(fill="CNR2 density") +
theme(text = element_text(size=18),legend.position = "right", legend.direction="vertical", legend.margin = margin(0, 0, 0, 0)) +
scale_fill_gradientn(colours = c("royalblue","firebrick","goldenrod"),na.value="grey")
cnresz_2= cnresz_2 %>%
group_by (Direction)
p_esz_2 <- ggseg(.data= cnresz_2, atlas="aseg",
mapping=aes(fill=vari)) +
labs(fill="Hedge's g") +
facet_wrap(~Direction, ncol=1) +
theme(text = element_text(size=18),legend.position = "right", legend.direction="vertical", legend.margin = margin(0, 0, 0, 0)) +
scale_fill_gradientn(colours = c("royalblue","firebrick","goldenrod"),na.value="grey")
cowplot::plot_grid(p_cnr1_2, p_cnr2_2, ncol =1,
labels = c("D", "E"),
align = "h", axis = "1")
cowplot::plot_grid(p_esz_2, ncol =1,
labels = c("F"),
align = "h", axis = "1")