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
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
VEBER Philippe
codepi
Commits
3062eefd
Commit
3062eefd
authored
Aug 10, 2018
by
Carine Rey
Browse files
new plots
parent
41678e0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
7 deletions
+45
-7
lib/scripts/calc_t_per_meth.R
lib/scripts/calc_t_per_meth.R
+45
-7
No files found.
lib/scripts/calc_t_per_meth.R
View file @
3062eefd
...
...
@@ -387,8 +387,46 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
)
}
else
{
plot_recall_precision_papier
=
NULL
}
}
print
(
"plot FPR"
)
x_labs
=
"Threshold"
y_labs
=
"FP Rate (1 -Spe)"
df_out_melt2
=
subset
(
df_out_melt
,
couple
%in%
c
(
"H0/HaPC NeG5"
,
"H0/HaPC NeG5_NeC_div2"
,
"H0/HaPC NeG5_NeC_x2"
))
df_out_melt2
$
couple
=
gsub
(
"/HaPC "
,
""
,
df_out_melt2
$
couple
)
df_out_melt2
=
subset
(
df_out_melt2
,
variable
==
"specificity"
)
df_out_melt2
$
FPR
=
1
-
df_out_melt2
$
value
df_recall_sup09_per_meth2
=
subset
(
df_recall_sup09_per_meth
,
couple
%in%
c
(
"H0/HaPC NeG5"
,
"H0/HaPC NeG5_NeC_div2"
,
"H0/HaPC NeG5_NeC_x2"
))
df_recall_sup09_per_meth2
$
couple
=
gsub
(
"/HaPC "
,
""
,
df_recall_sup09_per_meth2
$
couple
)
plot
=
ggplot
(
df_out_melt2
,
aes
(
x
=
threshold
,
y
=
FPR
,
col
=
couple
))
plot
=
plot
+
theme_bw
()
plot
=
plot
+
theme
(
legend.position
=
"top"
,
legend.background
=
element_rect
(
fill
=
"white"
,
size
=
0.5
,
linetype
=
"solid"
,
colour
=
"black"
))
+
guides
(
colour
=
guide_legend
(
override.aes
=
list
(
alpha
=
1
),
nrow
=
2
))
plot
=
plot
+
guides
(
fill
=
FALSE
)
+
theme
(
legend.position
=
"top"
)
plot
=
plot
+
labs
(
x
=
x_labs
,
y
=
y_labs
)
plot
=
plot
+
ylim
(
c
(
0
,
1
))
+
xlim
(
c
(
0
,
1
))
plot
=
plot
+
geom_step
(
size
=
1
,
alpha
=
alpha
)
plot
=
plot
+
scale_color_manual
(
values
=
colors
)
plot
=
plot
+
geom_vline
(
data
=
df_recall_sup09_per_meth2
,
aes
(
xintercept
=
threshold
,
col
=
couple
),
size
=
0.5
,
show.legend
=
NA
,
linetype
=
"dashed"
)
plot
=
plot
+
facet_grid
(
.
~
methode
,
scales
=
"free"
)
plot
=
plot
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
plot_FPR
=
plot
save_plot
(
paste0
(
opt
$
out
,
suffix
,
".FPR.pdf"
),
plot_FPR
,
ncol
=
0.4
*
length
(
unique
(
df_out_melt
$
methode
)),
nrow
=
1
,
base_aspect_ratio
=
1.5
,
limitsize
=
FALSE
)
print
(
"plot per indicator"
)
x_labs
=
"Threshold"
...
...
@@ -508,16 +546,16 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
# nrow=7
# )
plot
=
plot_grid
(
plot_recall_precision
,
plot_recall_precision_papier
,
plot_max_MCC
,
labels
=
c
(
"A"
,
"A'"
,
"B"
),
rel_heights
=
c
(
length
(
unique
(
df_out
$
couple
))
*
0.8
,
2
,
4
),
nrow
=
3
plot
=
plot_grid
(
plot_recall_precision
,
plot_recall_precision_papier
,
plot_max_MCC
,
plot_FPR
,
labels
=
c
(
"A"
,
"A'"
,
"B"
,
"B'"
),
rel_heights
=
c
(
length
(
unique
(
df_out
$
couple
))
*
0.8
,
2
,
4
,
2
),
nrow
=
4
)
save_plot
(
paste0
(
opt
$
out
,
suffix
,
".pdf"
),
plot
,
ncol
=
0.4
*
length
(
unique
(
df_out_melt
$
methode
)),
nrow
=
length
(
unique
(
df_out
$
couple
))
*
0.5
+
1
+
1
,
nrow
=
length
(
unique
(
df_out
$
couple
))
*
0.5
+
1
+
1
+1
,
base_aspect_ratio
=
1
,
limitsize
=
FALSE
)
...
...
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