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
Midoux Cedric
easy16S
Commits
5f0c2aad
Commit
5f0c2aad
authored
Sep 13, 2018
by
Midoux Cedric
Browse files
acpScript
parent
8ed00454
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.R
View file @
5f0c2aad
...
...
@@ -1215,8 +1215,52 @@ shinyServer
"acpRep"
,
label
=
"Barycenters : "
,
choices
=
c
(
"..."
=
0
,
sample_variables
(
data16S
()))
)
),
collapsedBox
(
verbatimTextOutput
(
"acpScript"
),
title
=
"RCode"
)
)
})
output
$
acpScript
<-
renderText
({
scriptArgs
<-
c
(
"physeq = data"
,
glue
(
"ordination = ordinate(data, method = \"{input$acpMethod}\", distance = \"{input$acpDist}\")"
),
glue
(
"axes = c({glue_collapse(input$acpAxes, sep = ', ')})"
)
)
if
(
!
is.null
(
checkNull
(
input
$
acpCol
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"color = \"{input$acpCol}\""
))
}
if
(
!
is.null
(
checkNull
(
input
$
acpShape
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"shape = \"{input$acpShape}\""
))
}
if
(
!
is.null
(
checkNull
(
input
$
acpRep
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"replicate = \"{input$acpRep}\""
))
}
else
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"replicate = NULL"
))
}
if
(
!
is.null
(
checkNull
(
input
$
acpLabel
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"label = \"{input$acpLabel}\""
))
}
if
(
!
is.null
(
checkNull
(
input
$
acpTitle
)))
{
scriptArgs
<-
c
(
scriptArgs
,
glue
(
"title = \"{input$acpTitle}\""
))
}
script
<-
c
(
scriptHead
,
"# MultiDimensional scaling"
,
glue
(
"p <- plot_samples({glue_collapse(scriptArgs, sep=', ')})"
)
)
if
(
!
is.null
(
checkNull
(
input
$
acpEllipse
)))
{
script
<-
c
(
script
,
glue
(
"p <- p + stat_ellipse(aes_string(group = \"{input$acpEllipse}\"))"
)
)
}
script
<-
c
(
script
,
""
,
"plot(p + theme_bw())"
)
return
(
glue_collapse
(
script
,
sep
=
"\n"
))
})
output
$
acp
<-
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