Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kunst, Jonathan
Polyploid datavisualisation
Commits
65e3b4e2
Commit
65e3b4e2
authored
Nov 09, 2021
by
Kunst, Jonathan
Browse files
Extended lodmod df to create extra information on tooltip
parent
8cef877d
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_script.R
View file @
65e3b4e2
...
...
@@ -49,65 +49,6 @@ plotQTL(LOD_data = qtl_LODs.4x,
plotLinearQTL
(
LOD_data
=
qtl_LODs.4x
,
col
=
"dodgerblue"
)
# plotly example
dfs
<-
qtl_LODs.4x
$
QTL.res
%>%
nest_by
(
chromosome
)
lapply
(
seq_along
(
dfs
$
data
),
function
(
i
){
plot_ly
(
dfs
$
data
[[
i
]],
x
=
~
position
,
y
=
~
LOD
,
type
=
'scatter'
,
mode
=
'lines'
)
%>%
layout
(
yaxis
=
list
(
title
=
'Logarithm of Odds (LOD)'
,
showgrid
=
FALSE
),
xaxis
=
list
(
title
=
str
(
i
),
showgrid
=
FALSE
))
})
%>%
subplot
(
.
,
shareX
=
FALSE
,
shareY
=
TRUE
,
titleX
=
TRUE
)
panel
<-
.
%>%
plot_ly
(
x
=
~
position
,
y
=
~
LOD
)
%>%
add_lines
()
%>%
add_annotations
(
text
=
~
unique
(
chromosome
),
x
=
0.5
,
y
=
0
,
yref
=
"paper"
,
xref
=
"paper"
,
yanchor
=
"bottom"
,
xanchor
=
'center'
,
yshift
=
-35
,
showarrow
=
FALSE
,
font
=
list
(
size
=
15
)
)
%>%
layout
(
showlegend
=
TRUE
,
shapes
=
list
(
type
=
"rect"
,
x0
=
0
,
x1
=
1
,
xref
=
"paper"
,
y0
=
0
,
y1
=
0
,
yanchor
=
'center'
,
yref
=
"paper"
,
ysizemode
=
"pixel"
,
fillcolor
=
toRGB
(
"gray80"
),
line
=
list
(
color
=
"transparent"
)
),
xaxis
=
list
(
showgrid
=
FALSE
),
yaxis
=
list
(
showgrid
=
FALSE
)
)
qtl_LODs.4x
$
QTL.res
%>%
mutate
(
chromosome
=
paste
(
'Linkage Group'
,
chromosome
))
%>%
group_by
(
chromosome
)
%>%
do
(
p
=
panel
(
.
))
%>%
subplot
(
nrows
=
1
,
shareX
=
FALSE
,
shareY
=
TRUE
)
plot_ly
(
qtl_LODs.4x
$
QTL.res
,
x
=
~
position
,
y
=
~
LOD
)
# sig thresholds with permutation tests
qtl_LODs.4x
<-
QTLscan
(
IBD_list
=
IBD_4x
,
Phenotype.df
=
Phenotypes_4x
,
...
...
@@ -217,9 +158,11 @@ lodsmod2 <- lodsmod1 %>%
LOD
=
jitter
(
LOD
,
1
,
0.25
),
.keep
=
'unused'
)
lodsmod
<-
rbind
(
lodsmod1
,
lodsmod2
)
lodsmod
<-
rbind
(
lodsmod1
,
lodsmod2
)
%>%
left_join
(
bind_rows
(
phased_maplist.4x
),
by
=
'position'
)
p
<-
ggplot
(
lodsmod
,
aes
(
x
=
position
,
y
=
LOD
,
color
=
model
))
+
p
<-
ggplot
(
lodsmod
,
aes
(
x
=
position
,
y
=
LOD
,
color
=
model
,
linetype
=
model
))
+
geom_line
()
+
facet_grid
(
~
chromosome
,
switch
=
'x'
,
...
...
Write
Preview
Supports
Markdown
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