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
e9de9648
Commit
e9de9648
authored
Sep 05, 2018
by
Midoux Cedric
Browse files
histScript
parent
226dc4d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.R
View file @
e9de9648
...
...
@@ -210,16 +210,66 @@ shinyServer
"barGrid"
,
label
=
"Subplot : "
,
choices
=
c
(
"..."
=
0
,
sample_variables
(
data16S
()))
)
,
),
selectInput
(
"barX"
,
label
=
"X : "
,
choices
=
c
(
"..."
=
0
,
sample_variables
(
data16S
()))
),
box
(
title
=
"RCode"
,
width
=
NULL
,
status
=
"primary"
,
collapsible
=
TRUE
,
collapsed
=
TRUE
,
verbatimTextOutput
(
"histScript"
)
)
)
})
output
$
histScript
<-
renderText
({
paste0
(
"# Loading packages\n"
,
"source(\"https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R\")\n"
,
"\n"
,
"# Loading data\n"
,
paste0
(
"load(\""
,
paste
(
"Easy16S-data"
,
Sys.Date
(),
"RData"
,
sep
=
"."
),
"\") # if necessary, adapt the file path\n"
),
"\n"
,
"# View data\n"
,
"data\n"
,
"\n"
,
"# Plot barplot\n"
,
"p <- plot_bar(physeq = data"
,
ifelse
(
is.null
(
checkNull
(
input
$
barFill
)),
""
,
paste0
(
",\n fill = \""
,
input
$
barFill
,
"\""
)
),
ifelse
(
is.null
(
checkNull
(
input
$
barX
)),
""
,
paste0
(
",\n x = "
,
input
$
barX
)),
ifelse
(
is.null
(
checkNull
(
input
$
barTitle
)),
""
,
paste0
(
",\n title = \""
,
input
$
barTitle
,
"\""
)
),
")\n"
,
ifelse
(
is.null
(
checkNull
(
input
$
barGrid
)),
""
,
paste0
(
"p <- p + facet_grid(\". ~ "
,
input
$
barGrid
,
"\", scales = \"free_x\")\n"
)
),
"\n"
,
"plot(p)"
)
})
output
$
histo
<-
renderPlot
({
validate
(
need
(
data16S
(),
"Requires an abundance dataset"
))
...
...
@@ -854,7 +904,11 @@ shinyServer
axes
=
as.numeric
(
input
$
acpAxes
),
title
=
checkNull
(
input
$
acpTitle
),
color
=
checkNull
(
input
$
acpCol
),
replicate
=
if
(
is.null
(
checkNull
(
input
$
acpRep
)))
{
NULL
}
else
{
checkNull
(
input
$
acpRep
)
},
replicate
=
if
(
is.null
(
checkNull
(
input
$
acpRep
)))
{
NULL
}
else
{
checkNull
(
input
$
acpRep
)
},
shape
=
checkNull
(
input
$
acpShape
),
label
=
checkNull
(
input
$
acpLabel
)
)
...
...
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