-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_fig2.R
149 lines (111 loc) · 5.04 KB
/
gen_fig2.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
library(ggplot2)
library(ggpmisc)
library(ggpubr)
library(ggcorrplot)
library(dplyr)
setwd("C:/Users/lr201/code/gene_prediction_pipeline")
# using pred_stat inquire ass_stat
data = read.csv("ass_pred_analysis_remove_na.csv", sep = ",")
data_log = log10(select(data, -1, -2) + 1)
theme_set(theme_bw())
corr <- round(cor(select(data, -1, -2)), 1)
ggcorrplot(corr, hc.order = TRUE, type = "lower",
lab = TRUE, lab_size = 3,
method="circle", colors = c("tomato2", "white", "springgreen3"),
title="Correlogram of ass_pred_stat", ggtheme=theme_bw)
# failed!
ass_stat = c(data$contig_N50, data$contig_num, data$genome_size)
pred_stat = c(data$gene_num, data$ips_item_num, data$running_time)
my.formula <- y ~ x
gs_gn = ggplot(data = data_log, aes(x = genome_size, y = gene_num)) +
geom_point(aes(col = data$lineage)) +
geom_smooth(method = lm, level = 0.90, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
gn_iin = ggplot(data = data_log, aes(x = gene_num, y = ips_item_num)) +
geom_point(aes(col = data$lineage)) +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
gs_iin = ggplot(data = data_log, aes(x = genome_size, y = ips_item_num)) +
geom_point(aes(col = data$lineage)) +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
gn_rt = ggplot(data = data_log, aes(x = gene_num, y = running_time)) +
geom_point(aes(col = data$lineage)) +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
library(lemon)
grid_arrange_shared_legend(gs_gn, gn_iin, gs_iin, gn_rt, ncol = 2, nrow = 2, position='top')
ggarrange(gs_gn, gn_iin, gs_iin, gn_rt + rremove("x.text"),
labels = c("A", "B", "C","D"),
ncol = 2, nrow = 2)
n50_gs = ggplot(data = data_log, aes(x = contig_N50, y = genome_size)) +
geom_point(aes(col = data$lineage)) +
geom_smooth(method = lm, level = 0.90, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
n50_gs
ggplot(data = data_log, aes(x = contig_num, y = running_time)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = y ~ x,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
ggplot(data = data, aes(x = genome_size, y = running_time)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
ggplot(data = data, aes(x = contig_N50, y = running_time)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
ggplot(data = data, aes(x = contig_N50, y = gene_num)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
ggplot(data = data, aes(x = contig_num, y = gene_num)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
ggplot(data = data, aes(x = contig_num, y = genome_size)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
ggplot(data = data, aes(x = contig_num, y = contig_N50)) +
geom_point() +
geom_smooth(method = lm, level = 0.95, colour = "#009900") +
stat_poly_eq(formula = my.formula,
aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
parse = TRUE)
# -------------------------------------------------------------------------
lab = c(0:25)
sha = c(1:26)
shap = data.frame(lab = lab,sha = sha)
ggplot(data = shap, aes(x = 1:26,y = sha)) +
geom_point(shape = lab, size = 3) +
geom_text(aes(label = lab,vjust = -1.5)) +
ylim(0,28) +
ggtitle("数字代表的点型")
ggplot(data = data, aes(x = genome_size, y = gene_num)) +
geom_point(colour="#339911", shape = 19,size = 1.5)
library(scales)
ggplot(data = data,aes(x=Petal.Length,y=Sepal.Length,colour=Species))+
geom_point()