-
Notifications
You must be signed in to change notification settings - Fork 0
/
genetic_load_count_plot.R
97 lines (89 loc) · 4.03 KB
/
genetic_load_count_plot.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
88
89
90
91
92
93
94
95
96
97
library(ggplot2)
library(ggpubr)
library(RColorBrewer)
library(qqman)
setwd("E:/博士/博士课题/巨柏/数据分析/重测序数据/genetic_load/delterious_load")
#plot LoF
data <- read.table("count.txt", header = T)
compaired = list(c("Cugi,Cudu"),c("Cugi,CuduN"),c("Cugi,CuduS"))
head(data)
class(data[,4])
ggplot(data, aes(x=catelory, y=LoF)) +
geom_boxplot(aes(fill = Species),varwidth = TRUE, outlier.shape = NA) +
scale_fill_manual(values = c(brewer.pal(7, "Set2")[c(1,2,4,5)])) +
theme_bw() +
theme_light()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(LoF~Species, data=d1, method = "t.test")
compare_means(LoF~Species, data=d2, method = "t.test")
#plot delterious
data <- read.table("count.txt", header = T)
compaired = list(c("Cugi,Cudu"),c("Cugi,CuduN"),c("Cugi,CuduS"))
head(data)
class(data[,4])
ggplot(data, aes(x=catelory, y=Deleterious)) +
geom_boxplot(aes(fill = Species),varwidth = TRUE, outlier.shape = NA) +
scale_fill_manual(values = c(brewer.pal(7, "Set2")[c(1,2,4,5)])) +
theme_bw() +
theme_light()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(Deleterious~Species, data=d1, method = "t.test")
compare_means(Deleterious~Species, data=d2, method = "t.test")
#plot tolerant
ggplot(data, aes(x=catelory, y=Tolerate)) +
geom_boxplot(aes(fill = Species),varwidth = TRUE, outlier.shape = NA) +
scale_fill_manual(values = c(brewer.pal(7, "Set2")[c(1,2,4,5)])) +
theme_bw() +
theme_light()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(Tolerate~Species, data=d1, method = "t.test")
compare_means(Tolerate~Species, data=d2, method = "t.test")
#plot syn
ggplot(data, aes(x=catelory, y=Syn)) +
geom_boxplot(aes(fill = Species),varwidth = TRUE, outlier.shape = NA) +
scale_fill_manual(values = c(brewer.pal(7, "Set2")[c(1,2,4,5)])) +
theme_bw() +
theme_light()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(Tolerate~Species, data=d1, method = "t.test")
compare_means(Tolerate~Species, data=d2, method = "t.test")
#plot LoF_count_ratio
data = read.table("count_ratio.txt", header = TRUE)
head(data)
ggplot(data, aes(x= Species, y= LoF, shape = catelory, color = catelory)) +
geom_point(size = 2)+
scale_shape_manual(values = c(1,2))+
facet_grid(.~catelory)+
stat_summary(fun = mean, geom = "point", shape = "-", color= "black", size = 10) +
stat_compare_means(comparisons = compaired, label = "p.signif", method = "t.test", ref.group = "Cugi", hide.ns = TRUE)+
theme_bw()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(LoF~Species, data=d1, method = "t.test")
compare_means(LoF~Species, data=d2, method = "t.test")
ggplot(data, aes(x= Species, y= Deleterious, shape = catelory, color = catelory)) +
geom_point(size = 2)+
scale_shape_manual(values = c(1,2))+
facet_grid(.~catelory)+
stat_summary(fun = mean, geom = "point", shape = "-", color= "black", size = 10) +
stat_compare_means(comparisons = compaired, label = "p.signif", method = "t.test", ref.group = "Cugi", hide.ns = TRUE)+
theme_bw()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(Deleterious~Species, data=d1, method = "t.test")
compare_means(Deleterious~Species, data=d2, method = "t.test")
ggplot(data, aes(x= Species, y= Tolerate, shape = catelory, color = catelory)) +
geom_point(size = 2)+
scale_shape_manual(values = c(1,2))+
facet_grid(.~catelory)+
stat_summary(fun = mean, geom = "point", shape = "-", color= "black", size = 10) +
stat_compare_means(comparisons = compaired, label = "p.signif", method = "t.test", ref.group = "Cugi", hide.ns = TRUE)+
theme_bw()
d1 = subset(data, catelory=="Hom_ratio")
d2 = subset(data, catelory == "Het_ratio")
compare_means(Tolerate~Species, data=d1, method = "t.test")
compare_means(Tolerate~Species, data=d2, method = "t.test")