Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Perréal
easy16S
Commits
8ed00454
Commit
8ed00454
authored
Sep 13, 2018
by
Midoux Cedric
Browse files
treeScript
parent
94ef920c
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.R
View file @
8ed00454
...
...
@@ -1044,7 +1044,7 @@ shinyServer
})
output
$
treeUI
<-
renderUI
({
validate
(
need
(
data16S
(
),
""
))
validate
(
need
(
phy_tree
(
data16S
(),
errorIfNULL
=
FALSE
),
""
))
box
(
title
=
"Setting : "
,
width
=
NULL
,
...
...
@@ -1078,8 +1078,52 @@ shinyServer
"treeShape"
,
label
=
"Shape : "
,
choices
=
c
(
"..."
=
0
,
sample_variables
(
data16S
()))
),
collapsedBox
(
verbatimTextOutput
(
"treeScript"
),
title
=
"RCode"
)
)
})
output
$
treeScript
<-
renderText
({
scriptArgs
<-
c
(
glue
(
"physeq = prune_taxa(names(sort(taxa_sums(data), decreasing = TRUE)[1:{input$treeTopOtu}]), data)"
)
)
if
(
input
$
treeSample
)
{
scriptArgs
<-
c
(
scriptArgs
,
"method = \"sampledodge\""
)
}
else
{
scriptArgs
<-
c
(
scriptArgs
,
"method = \"treeonly\""
)
}
if
(
!
is.null
(
checkNull
(
input
$
treeCol
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"color = \"{input$treeCol}\""
))
}
if
(
!
is.null
(
checkNull
(
input
$
treeShape
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"shape = \"{input$treeShape}\""
))
}
scriptArgs
<-
c
(
scriptArgs
,
"size = \"abundance\""
)
if
(
!
is.null
(
checkNull
(
input
$
treeRank
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"label.tips = \"{input$treeRank}\""
))
}
scriptArgs
<-
c
(
scriptArgs
,
"sizebase = 5"
,
"ladderize = \"left\""
,
"plot.margin = 0"
)
if
(
!
is.null
(
checkNull
(
input
$
treeTitle
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"title = \"{input$treeTitle}\""
))
}
script
<-
c
(
scriptHead
,
"# Plot phylogenetic tree"
,
glue
(
"p <- plot_tree({glue_collapse(scriptArgs, sep=', ')})"
)
)
if
(
input
$
treeRadial
)
{
script
<-
c
(
script
,
"p <- p + coord_polar(theta = \"y\")"
)
}
script
<-
c
(
script
,
""
,
"plot(p)"
)
return
(
glue_collapse
(
script
,
sep
=
"\n"
))
})
output
$
tree
<-
renderPlot
({
...
...
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