Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VEBER Philippe
codepi
Commits
1a767716
Commit
1a767716
authored
Sep 25, 2018
by
Carine Rey
Browse files
update figures
parent
8839c5a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
146 additions
and
102 deletions
+146
-102
lib/scripts/calc_t_per_meth.R
lib/scripts/calc_t_per_meth.R
+146
-102
No files found.
lib/scripts/calc_t_per_meth.R
View file @
1a767716
...
...
@@ -697,7 +697,7 @@ plot_out = function(df_out, df_d , df_auc, df_recall_sup09_per_meth, meths = NUL
print
(
couple_i
[
!
couple_i
%in%
df_out
$
couple
])
print
(
all
(
couple_i
%in%
df_out
$
couple
))
if
(
length
(
meths
)
<=
9
&
all
(
couple_i
%in%
df_out
$
couple
))
{
if
(
length
(
meths
)
<=
9
&
sum
(
couple_i
%in%
df_out
$
couple
)
>=
1
)
{
plot
=
ggplot
(
df_out
,
aes
(
x
=
sensitivity
,
y
=
precision98_02
,
col
=
methode
))
plot
=
plot
+
theme_bw
()
plot
=
plot
+
labs
(
x
=
"Sensitivity (= Recall)"
,
y
=
"Precision (98/2)"
)
...
...
@@ -736,109 +736,151 @@ plot_out = function(df_out, df_d , df_auc, df_recall_sup09_per_meth, meths = NUL
)
plot_PR_c
=
function
(
couple_l
)
{
tmp_df
=
subset
(
df_out
,
couple
%in%
couple_l
)
tmp_df
$
couple
=
factor
(
tmp_df
$
couple
,
levels
=
c
(
levels
(
tmp_df
$
couple
),
"to_be_rm"
,
"to_be_rm2"
,
"to_be_rm3"
,
"to_be_rm4"
))
if
(
"NULL"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm"
}
if
(
"NULL2"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm2"
}
if
(
"NULL3"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm3"
}
if
(
"NULL4"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm4"
}
from_m
=
c
(
"PCOC"
,
"Mutinomial_1MinusLRT"
,
"Msd_0.05_1MinusP"
,
"Identical_LG08"
,
"Tdg09_1MinusLRT"
,
"Topological_LG08"
,
"diffsel_mean"
)
to_m
=
c
(
"PCOC"
,
"Mutinomial"
,
"msd"
,
"Identical"
,
"TDG09"
,
"Topological"
,
"diffsel"
)
tmp_df
$
methode
=
mapvalues
(
tmp_df
$
methode
,
from
=
from_m
,
to
=
to_m
)
tmp_df
$
methode
=
factor
(
tmp_df
$
methode
,
levels
=
to_m
)
from_c
=
c
(
couple_plot1
,
couple_plot2
,
couple_plot3
,
couple_plot4
)
couple_plot1_to
=
c
(
"PC NeSG1"
,
"PC NeSG4"
,
"PC NeSG8"
)
couple_plot2_to
=
c
(
"CCSE NeSG1 NeSG1 NeSC 4"
,
"CCSE NeSG4 NeSC 8"
,
"CCSE NeSG8 NeSC 1"
)
couple_plot3_to
=
c
(
"PC & GCSE NeSG1 NeSC 4"
,
"PC & GCSE NeSG4 NeSC 8"
,
"PC & GCSE NeSG8 NeSC 1"
)
couple_plot4_to
=
c
(
"PC & CCSE NeSG1 NeSC 4"
,
"PC & CCSE NeSG4 NeSC 8"
,
"PC & CCSE NeSG8 NeSC 1"
)
to_c
=
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot3_to
,
couple_plot4_to
)
tmp_df
$
coupleF
=
mapvalues
(
tmp_df
$
couple
,
from
=
from_c
,
to
=
to_c
)
tmp_df
$
coupleF
=
factor
(
tmp_df
$
coupleF
,
levels
=
unique
(
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot4_to
,
couple_plot3_to
)))
plot
=
ggplot
(
tmp_df
,
aes
(
x
=
sensitivity
,
y
=
precision98_02
,
col
=
methode
))
plot
=
plot
+
theme_bw
()
plot
=
plot
+
labs
(
x
=
"Sensitivity (= Recall)"
,
y
=
"Precision"
)
plot
=
plot
+
theme
(
legend.position
=
"top"
)
plot
=
plot
+
ylim
(
c
(
0
,
1
))
+
xlim
(
c
(
0
,
1
))
plot
=
plot
+
guides
(
fill
=
FALSE
)
plot
=
plot
+
scale_color_manual
(
values
=
colors2
)
#plot = plot + geom_point(size=1, alpha=alpha)
plot
=
plot
+
geom_step
(
direction
=
"vh"
,
size
=
1
,
alpha
=
alpha
)
if
(
length
(
couple_l
)
<
8
)
{
#add AUC values
df_auc_label
=
subset
(
df_auc
,
couple
%in%
tmp_df
$
couple
)
df_auc_label
$
coupleF
=
mapvalues
(
df_auc_label
$
couple
,
from
=
from_c
,
to
=
to_c
)
df_auc_label
=
df_auc_label
[
df_auc_label
$
auc2
>=
0.001
,]
from_r
=
c
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
)
to_y
=
0.8
-
0.1
*
from_r
df_auc_label
$
y
=
mapvalues
(
df_auc_label
$
auc2_rank
,
from
=
from_r
,
to
=
to_y
)
df_auc_label
$
methode
=
mapvalues
(
df_auc_label
$
methode
,
from
=
from_m
,
to
=
to_m
)
df_auc_label
$
label
=
substr
(
as.character
(
df_auc_label
$
auc2
),
1
,
5
)
df_auc_leg
=
data.frame
(
coupleF
=
unique
(
tmp_df
$
coupleF
),
x
=
0.9
,
y
=
0.8
,
label
=
"AUC "
)
plot
=
plot
+
geom_label
(
data
=
df_auc_label
,
aes
(
x
=
0.9
,
y
=
y
,
label
=
label
,
col
=
methode
),
size
=
2.5
,
label.padding
=
unit
(
0.15
,
"lines"
))
plot
=
plot
+
geom_label
(
data
=
df_auc_leg
,
aes
(
x
=
x
,
y
=
y
,
label
=
label
),
col
=
"black"
,
size
=
2.5
,
label.padding
=
unit
(
0.15
,
"lines"
))
if
(
sum
(
couple_l
%in%
df_out
$
couple
)
>
0
)
{
print
(
"PAS OK"
)
tmp_df
=
subset
(
df_out
,
couple
%in%
couple_l
)
tmp_df
$
couple
=
factor
(
tmp_df
$
couple
,
levels
=
c
(
levels
(
tmp_df
$
couple
),
"to_be_rm"
,
"to_be_rm2"
,
"to_be_rm3"
,
"to_be_rm4"
))
if
(
"NULL"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm"
}
if
(
"NULL2"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm2"
}
if
(
"NULL3"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm3"
}
if
(
"NULL4"
%in%
couple_l
)
{
tmp_df
[
dim
(
tmp_df
)[
1
]
+1
,]
=
tmp_df
[
dim
(
tmp_df
)[
1
],]
tmp_df
$
couple
[
dim
(
tmp_df
)[
1
]]
=
"to_be_rm4"
}
from_m
=
c
(
"PCOC"
,
"Mutinomial_1MinusLRT"
,
"Msd_0.05_1MinusP"
,
"Identical_LG08"
,
"Tdg09_1MinusLRT"
,
"Topological_LG08"
,
"Diffsel_mean"
)
to_m
=
c
(
"PCOC"
,
"Mutinomial"
,
"msd"
,
"Identical"
,
"TDG09"
,
"Topological"
,
"diffsel"
)
tmp_df
$
methode
=
mapvalues
(
tmp_df
$
methode
,
from
=
from_m
,
to
=
to_m
)
tmp_df
$
methode
=
factor
(
tmp_df
$
methode
,
levels
=
to_m
)
from_c
=
c
(
couple_plot1
,
couple_plot2
,
couple_plot3
,
couple_plot4
)
couple_plot1_to
=
c
(
"PC NeS 1"
,
"PC NeS 4"
,
"PC NeS 8"
)
couple_plot2_to
=
c
(
"CCSE NeSA1 NeSC 4"
,
"CCSE NeSA4 NeSC 8"
,
"CCSE NeSA8 NeSC 1"
)
couple_plot3_to
=
c
(
"PC & GCSE NeSA1 NeSC 4"
,
"PC & GCSE NeSA4 NeSC 8"
,
"PC & GCSE NeSA8 NeSC 1"
)
couple_plot4_to
=
c
(
"PC & CCSE NeSA1 NeSC 4"
,
"PC & CCSE NeSA4 NeSC 8"
,
"PC & CCSE NeSA8 NeSC 1"
)
to_c
=
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot3_to
,
couple_plot4_to
)
tmp_df
$
coupleF
=
mapvalues
(
tmp_df
$
couple
,
from
=
from_c
,
to
=
to_c
)
tmp_df
$
coupleF
=
factor
(
tmp_df
$
coupleF
,
levels
=
unique
(
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot4_to
,
couple_plot3_to
)))
plot
=
ggplot
(
tmp_df
,
aes
(
x
=
sensitivity
,
y
=
precision98_02
,
col
=
methode
))
plot
=
plot
+
theme_bw
()
plot
=
plot
+
labs
(
x
=
"Sensitivity (= Recall)"
,
y
=
"Precision"
)
plot
=
plot
+
theme
(
legend.position
=
"top"
)
plot
=
plot
+
ylim
(
c
(
0
,
1
))
+
xlim
(
c
(
0
,
1
))
plot
=
plot
+
guides
(
fill
=
FALSE
)
plot
=
plot
+
scale_color_manual
(
values
=
colors2
)
#plot = plot + geom_point(size=1, alpha=alpha)
plot
=
plot
+
geom_step
(
direction
=
"vh"
,
size
=
1
,
alpha
=
alpha
)
if
(
length
(
couple_l
)
<
8
)
{
#add AUC values
df_auc_label
=
subset
(
df_auc
,
couple
%in%
tmp_df
$
couple
)
df_auc_label
$
coupleF
=
mapvalues
(
df_auc_label
$
couple
,
from
=
from_c
,
to
=
to_c
)
df_auc_label
=
df_auc_label
[
df_auc_label
$
auc2
>=
0.001
,]
from_r
=
c
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
)
to_y
=
0.8
-
0.1
*
from_r
df_auc_label
$
y
=
mapvalues
(
df_auc_label
$
auc2_rank
,
from
=
from_r
,
to
=
to_y
)
df_auc_label
$
methode
=
mapvalues
(
df_auc_label
$
methode
,
from
=
from_m
,
to
=
to_m
)
df_auc_label
$
label
=
substr
(
as.character
(
df_auc_label
$
auc2
),
1
,
5
)
df_auc_leg
=
data.frame
(
coupleF
=
unique
(
tmp_df
$
coupleF
),
x
=
0.9
,
y
=
0.8
,
label
=
"AUC "
)
plot
=
plot
+
geom_label
(
data
=
df_auc_label
,
aes
(
x
=
0.9
,
y
=
y
,
label
=
label
,
col
=
methode
),
size
=
2.5
,
label.padding
=
unit
(
0.15
,
"lines"
))
plot
=
plot
+
geom_label
(
data
=
df_auc_leg
,
aes
(
x
=
x
,
y
=
y
,
label
=
label
),
col
=
"black"
,
size
=
2.5
,
label.padding
=
unit
(
0.15
,
"lines"
))
}
plot
=
plot
+
geom_hline
(
aes
(
yintercept
=
0.9
),
col
=
"black"
,
size
=
0.5
,
show.legend
=
NA
,
linetype
=
"dashed"
)
plot
=
plot
+
facet_grid
(
.
~
coupleF
)
plot
=
plot
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
plot
}
else
{
print
(
"OK"
)
plot
=
NULL
}
plot
=
plot
+
geom_hline
(
aes
(
yintercept
=
0.9
),
col
=
"black"
,
size
=
0.5
,
show.legend
=
NA
,
linetype
=
"dashed"
)
plot
=
plot
+
facet_grid
(
.
~
coupleF
)
plot
=
plot
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
plot
}
plot_AUC_c
=
function
(
couple_l
)
{
tmp_df
=
subset
(
df_auc
,
couple
%in%
couple_l
)
tmp_df
$
group
=
"group0"
couple_NeSG1
=
couple_l
[
grep
(
"NeG1"
,
couple_l
)]
couple_NeSG4
=
couple_l
[
grep
(
"NeG4"
,
couple_l
)]
couple_NeSG8
=
couple_l
[
grep
(
"NeG8"
,
couple_l
)]
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_NeSG1
]
=
"NeSG1"
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_NeSG4
]
=
"NeSG4"
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_NeSG8
]
=
"NeSG8"
from_c
=
c
(
couple_plot1
,
couple_plot2
,
couple_plot3
,
couple_plot4
)
couple_plot1_to
=
c
(
"PC"
,
"PC"
,
"PC"
)
couple_plot2_to
=
c
(
"CCSE NeSC 4"
,
"CCSE NeSC 8"
,
"CCSE NeSC 1"
)
couple_plot3_to
=
c
(
"PC & GCSE NeSC 4"
,
"PC & GCSE NeSC 8"
,
"PC & GCSE NeSC 1"
)
couple_plot4_to
=
c
(
"PC & CCSE NeSC 4"
,
"PC & CCSE NeSC 8"
,
"PC & CCSE NeSC 1"
)
to_c
=
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot3_to
,
couple_plot4_to
)
tmp_df
$
coupleX
=
mapvalues
(
tmp_df
$
couple
,
from
=
from_c
,
to
=
to_c
)
tmp_df
$
coupleX
=
factor
(
tmp_df
$
coupleX
,
levels
=
unique
(
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot4_to
,
couple_plot3_to
)))
from_m
=
c
(
"PCOC"
,
"Mutinomial_1MinusLRT"
,
"Msd_0.05_1MinusP"
,
"Identical_LG08"
,
"Tdg09_1MinusLRT"
,
"Topological_LG08"
,
"diffsel_mean"
)
to_m
=
c
(
"PCOC"
,
"Mutinomial"
,
"msd"
,
"Identical"
,
"TDG09"
,
"Topological"
,
"diffsel"
)
tmp_df
$
methode
=
mapvalues
(
tmp_df
$
methode
,
from
=
from_m
,
to
=
to_m
)
tmp_df
$
methode
=
factor
(
tmp_df
$
methode
,
levels
=
to_m
)
plot
=
ggplot
(
tmp_df
,
aes
(
x
=
coupleX
,
y
=
auc2
,
col
=
methode
))
plot
=
plot
+
theme_bw
()
plot
=
plot
+
labs
(
x
=
""
,
y
=
"AUC"
)
plot
=
plot
+
theme
(
legend.position
=
"top"
)
plot
=
plot
+
ylim
(
c
(
0
,
1
))
plot
=
plot
+
guides
(
fill
=
FALSE
)
plot
=
plot
+
scale_color_manual
(
values
=
colors2
)
#plot = plot + geom_point(size=1, alpha=alpha)
plot
=
plot
+
geom_point
(
na.rm
=
TRUE
,
position
=
position_dodge
(
width
=
0.5
),
size
=
1.5
,
alpha
=
1
)
plot
=
plot
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
plot
=
plot
+
facet_grid
(
.
~
group
,
scales
=
"free"
,
space
=
"free"
)
plot_AUC_c
=
function
(
couple_l
,
noA
=
F
)
{
if
(
sum
(
couple_l
%in%
df_out
$
couple
)
>
0
)
{
tmp_df
=
subset
(
df_auc
,
couple
%in%
couple_l
)
tmp_df
$
group
=
"group0"
#couple_NeSG1 = couple_l[grep("NeG1",couple_l)]
#couple_NeSG4 = couple_l[grep("NeG4",couple_l)]
#couple_NeSG8 = couple_l[grep("NeG8",couple_l)]
#tmp_df$group[tmp_df$couple%in%couple_NeSG1] = "NeSG1"
#tmp_df$group[tmp_df$couple%in%couple_NeSG4] = "NeSG4"
#tmp_df$group[tmp_df$couple%in%couple_NeSG8] = "NeSG8"
couple_simuA
=
c
(
"H0/HaPC NeG1"
,
"H0/HaPC NeG4"
,
"H0/HaPC NeG8"
)
couple_simuB
=
c
(
"H0/H0 NeG1/NeG1_NeC_4"
,
"H0/H0 NeG4/NeG4_NeC_8"
,
"H0/H0 NeG8/NeG8_NeC_1"
)
couple_simuC
=
c
(
"H0/HaPC NeG1"
,
"H0/HaPC NeG8_NeC_1"
,
"H0/HaPC NeG4"
,
"H0/HaPC NeG1_NeC_4"
,
"H0/HaPC NeG8"
,
"H0/HaPC NeG4_NeC_8"
)
couple_simuD
=
c
(
"H0/HaPC NeG1"
,
"H0/HaPC NeG4"
,
"H0/HaPC NeG8"
,
"H0 NeG1/HaPC NeG1_NeC_4"
,
"H0 NeG4/HaPC NeG4_NeC_8"
,
"H0 NeG8/HaPC NeG8_NeC_1"
)
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_simuA
]
=
"PC"
tmp_df2
=
tmp_df
[
tmp_df
$
couple
%in%
couple_simuA
,]
if
(
all
(
couple_simuB
%in%
tmp_df
$
couple
))
{
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_simuB
]
=
"CCSE"
tmp_df2
=
rbind
(
tmp_df2
,
tmp_df
[
tmp_df
$
couple
%in%
couple_simuB
,])
}
if
(
all
(
couple_simuC
%in%
tmp_df
$
couple
))
{
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_simuC
]
=
"PC & GWCSE"
if
(
noA
)
{
tmp_df2
=
tmp_df
[
tmp_df
$
couple
%in%
couple_simuC
,]
}
else
{
tmp_df2
=
rbind
(
tmp_df2
,
tmp_df
[
tmp_df
$
couple
%in%
couple_simuC
,])
}
}
if
(
all
(
couple_simuD
%in%
tmp_df
$
couple
))
{
tmp_df
$
group
[
tmp_df
$
couple
%in%
couple_simuD
]
=
"PC & CCSE"
tmp_df2
=
rbind
(
tmp_df2
,
tmp_df
[
tmp_df
$
couple
%in%
couple_simuD
,])
}
tmp_df
=
tmp_df2
from_c
=
c
(
couple_plot1
,
couple_plot2
,
couple_plot3
,
couple_plot4
)
couple_plot1_to
=
c
(
"NeS 1"
,
"NeS 4"
,
"NeS 8"
)
couple_plot2_to
=
c
(
"NeSA 1\nNeSC 4"
,
"NeSA 4\nNeSC 8"
,
"NeSA 8\nNeSC 1"
)
couple_plot3_to
=
c
(
"NeSA 1\nNeSC 4"
,
"NeSA 4\nNeSC 8"
,
"NeSA 8\nNeSC 1"
)
couple_plot4_to
=
c
(
"NeSA 1\nNeSC 4"
,
"NeSA 4\nNeSC 8"
,
"NeSA 8\nNeSC 1"
)
to_c
=
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot3_to
,
couple_plot4_to
)
tmp_df
$
coupleX
=
mapvalues
(
tmp_df
$
couple
,
from
=
from_c
,
to
=
to_c
)
tmp_df
$
coupleX
=
factor
(
tmp_df
$
coupleX
,
levels
=
c
(
"NeS 1"
,
"NeSA 8\nNeSC 1"
,
"NeS 4"
,
"NeSA 1\nNeSC 4"
,
"NeS 8"
,
"NeSA 4\nNeSC 8"
))
from_m
=
c
(
"PCOC"
,
"Mutinomial_1MinusLRT"
,
"Msd_0.05_1MinusP"
,
"Identical_LG08"
,
"Tdg09_1MinusLRT"
,
"Topological_LG08"
,
"Diffsel_mean"
)
to_m
=
c
(
"PCOC"
,
"Mutinomial"
,
"msd"
,
"Identical"
,
"TDG09"
,
"Topological"
,
"diffsel"
)
tmp_df
$
methode
=
mapvalues
(
tmp_df
$
methode
,
from
=
from_m
,
to
=
to_m
)
tmp_df
$
methode
=
factor
(
tmp_df
$
methode
,
levels
=
to_m
)
plot
=
ggplot
(
tmp_df
,
aes
(
x
=
coupleX
,
y
=
auc2
,
col
=
methode
,
shape
=
methode
,
fill
=
methode
))
plot
=
plot
+
theme_bw
()
plot
=
plot
+
labs
(
x
=
""
,
y
=
"AUC"
)
plot
=
plot
+
theme
(
legend.position
=
"top"
)
plot
=
plot
+
ylim
(
c
(
0
,
1
))
plot
=
plot
+
guides
(
fill
=
FALSE
)
plot
=
plot
+
scale_color_manual
(
values
=
colors2
)
plot
=
plot
+
scale_fill_manual
(
values
=
colors2
)
#plot = plot + geom_point(size=1, alpha=alpha)
plot
=
plot
+
geom_point
(
na.rm
=
TRUE
,
position
=
position_dodge
(
width
=
0.5
),
size
=
3
,
alpha
=
1
)
plot
=
plot
+
scale_shape_manual
(
values
=
c
(
16
,
18
,
10
,
7
,
17
,
25
,
15
))
#plot = plot + theme(axis.text.x = element_text(angle =45, hjust = 1))
plot
=
plot
+
facet_grid
(
.
~
group
,
scales
=
"free"
,
space
=
"free"
)
}
else
{
plot
=
NULL
}
plot
}
plot_Best_R_c
=
function
(
couple_l
)
{
if
(
sum
(
couple_l
%in%
df_out
$
couple
)
==
0
)
{
return
(
NULL
)}
tmp_df
=
subset
(
df_auc
,
couple
%in%
couple_l
)
tmp_df
$
group
=
"group0"
couple_NeSG1
=
couple_l
[
grep
(
"NeG1"
,
couple_l
)]
...
...
@@ -851,13 +893,13 @@ plot_out = function(df_out, df_d , df_auc, df_recall_sup09_per_meth, meths = NUL
from_c
=
c
(
couple_plot1
,
couple_plot2
,
couple_plot3
,
couple_plot4
)
couple_plot1_to
=
c
(
"PC"
,
"PC"
,
"PC"
)
couple_plot2_to
=
c
(
"CCSE NeSC 4"
,
"CCSE NeSC 8"
,
"CCSE NeSC 1"
)
couple_plot3_to
=
c
(
"PC & GCSE NeSC 4"
,
"PC & GCSE NeSC 8"
,
"PC & GCSE NeSC 1"
)
couple_plot3_to
=
c
(
"PC & G
W
CSE NeSC 4"
,
"PC & G
W
CSE NeSC 8"
,
"PC & G
W
CSE NeSC 1"
)
couple_plot4_to
=
c
(
"PC & CCSE NeSC 4"
,
"PC & CCSE NeSC 8"
,
"PC & CCSE NeSC 1"
)
to_c
=
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot3_to
,
couple_plot4_to
)
tmp_df
$
coupleX
=
mapvalues
(
tmp_df
$
couple
,
from
=
from_c
,
to
=
to_c
)
tmp_df
$
coupleX
=
factor
(
tmp_df
$
coupleX
,
levels
=
unique
(
c
(
couple_plot1_to
,
couple_plot2_to
,
couple_plot4_to
,
couple_plot3_to
)))
from_m
=
c
(
"PCOC"
,
"Mutinomial_1MinusLRT"
,
"Msd_0.05_1MinusP"
,
"Identical_LG08"
,
"Tdg09_1MinusLRT"
,
"Topological_LG08"
,
"
d
iffsel_mean"
)
from_m
=
c
(
"PCOC"
,
"Mutinomial_1MinusLRT"
,
"Msd_0.05_1MinusP"
,
"Identical_LG08"
,
"Tdg09_1MinusLRT"
,
"Topological_LG08"
,
"
D
iffsel_mean"
)
to_m
=
c
(
"PCOC"
,
"Mutinomial"
,
"msd"
,
"Identical"
,
"TDG09"
,
"Topological"
,
"diffsel"
)
tmp_df
$
methode
=
mapvalues
(
tmp_df
$
methode
,
from
=
from_m
,
to
=
to_m
)
tmp_df
$
methode
=
factor
(
tmp_df
$
methode
,
levels
=
to_m
)
...
...
@@ -880,10 +922,12 @@ plot_out = function(df_out, df_d , df_auc, df_recall_sup09_per_meth, meths = NUL
plot
=
plot_PR_c
(
couple_i
)
plot1
=
plot_PR_c
(
couple_plot1
)
plot1
=
plot_PR_c
(
c
(
"H0/HaPC NeG4"
,
"NULL2"
,
"NULL"
))
plot2
=
plot_PR_c
(
couple_plot2
)
plot3
=
plot_PR_c
(
couple_plot3
)
plot4
=
plot_PR_c
(
couple_plot4
)
plot5
=
plot_AUC_c
(
couple_i
)
plot5
=
plot_AUC_c
(
c
(
couple_plot1
,
couple_plot2
))
plot52
=
plot_AUC_c
(
c
(
couple_plot1
,
couple_plot3
,
couple_plot4
),
noA
=
T
)
plot6
=
plot_Best_R_c
(
couple_i
)
legend_PR
=
get_legend
(
plot
+
theme
(
legend.position
=
"top"
,
...
...
@@ -927,10 +971,10 @@ plot_out = function(df_out, df_d , df_auc, df_recall_sup09_per_meth, meths = NUL
rel_heights
=
c
(
0.2
,
0.7
,
0.05
,
0.7
,
0.05
,
0.7
,
0.05
,
0.7
,
0.05
,
0.7
),
hjust
=
0
,
vjust
=
0
)
plot_recall_precision_papier_ok
=
plot_grid
(
legend_
PR
,
plot_recall_precision_papier_ok
=
plot_grid
(
legend_
AUC
,
plot1
+
theme
(
legend.position
=
"none"
),
plot5
+
theme
(
legend.position
=
"none"
),
plot
6
+
theme
(
legend.position
=
"none"
),
plot
52
+
theme
(
legend.position
=
"none"
),
ncol
=
1
,
scale
=
1
,
labels
=
c
(
""
,
"A"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment