-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinal_ne.R
26 lines (23 loc) · 946 Bytes
/
final_ne.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
library(data.table)
library(ggplot2)
source("../../settings/plot_settings.R")
dt = fread("syn_summary.txt")
sample_dt = dt[ne=="sample"]
dt = dt[ne!="sample"]
dt[, ne:=as.numeric(ne)]
p1 = ggplot(dt[upper == 0], aes(y = prob_minor, x = ne)) +
theme_nature() +
geom_point() + geom_path() +
geom_hline(data = sample_dt[upper == 0], aes(yintercept = prob_minor), color = "red", linetype = "dashed") +
labs(x = "final Ne", y = "probability", title = "random")
dt = fread("syn_summary_highmu.txt")
sample_dt = dt[ne=="sample"]
dt = dt[ne!="sample"]
dt[, ne:=as.numeric(ne)]
p2 = ggplot(dt[upper == 0], aes(y = prob_minor, x = ne)) +
theme_nature() +
geom_point() + geom_path() +
geom_hline(data = sample_dt[upper == 0], aes(yintercept = prob_minor), color = "red", linetype = "dashed") +
labs(x = "final Ne", y = "probability", title = "high mutation rate")
arrange_nature(p1, p2)
save_nature("figure/final_ne.pdf", hw_ratio = 1/2)