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
ece485db
Commit
ece485db
authored
Sep 11, 2018
by
Midoux Cedric
Browse files
richnessAScript
parent
d462227a
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.R
View file @
ece485db
...
...
@@ -258,12 +258,13 @@ shinyServer
is.null
(
checkNull
(
input
$
barGrid
)),
""
,
glue
(
"p <- p + facet_grid(\". ~ {input$barGrid}\", scales = \"free_x\")"
"p <- p + facet_grid(\". ~ {input$barGrid}\", scales = \"free_x\")
"
)
),
),
"\n"
,
"plot(p)"
)
)
})
output
$
histo
<-
renderPlot
({
...
...
@@ -530,7 +531,65 @@ shinyServer
"richnessShape"
,
label
=
"Shape : "
,
choices
=
c
(
"..."
=
0
,
sample_variables
(
data16S
()))
)
),
collapsedBox
(
verbatimTextOutput
(
"richnessAScript"
),
title
=
"RCode"
)
)
})
output
$
richnessAScript
<-
renderText
({
paste0
(
scriptHead
,
"# Plot boxplot of alpha diversity\n"
,
"p <- plot_richness(physeq = data"
,
ifelse
(
is.null
(
checkNull
(
input
$
richnessX
)),
""
,
glue
(
", x = \"{input$richnessX}\""
)
),
ifelse
(
is.null
(
checkNull
(
input
$
richnessColor
)),
""
,
glue
(
", color = \"{input$richnessColor}\""
)
),
ifelse
(
is.null
(
checkNull
(
input
$
richnessShape
)),
""
,
glue
(
", shape = \"{input$richnessShape}\""
)
),
ifelse
(
is.null
(
checkNull
(
input
$
richnessTitle
)),
""
,
glue
(
", title = \"{input$richnessTitle}\""
)
),
ifelse
(
is.null
(
checkNull
(
input
$
richnessMeasures
)),
""
,
glue
(
", measures = c(\"{glue_collapse(input$richnessMeasures, sep='\", \"')}\")"
)
),
")\n"
,
ifelse
((
input
$
richnessBoxplot
>=
2
),
"p <- p + geom_boxplot()\n"
,
""
),
ifelse
((
input
$
richnessBoxplot
<=
2
),
"p <- p + geom_point()\n"
,
""
),
"\n"
,
"plot(p)"
,
"\n"
,
"\n"
,
"# Tables\n"
,
glue
(
"t <- estimate_richness(data"
),
ifelse
(
is.null
(
checkNull
(
input
$
richnessMeasures
)),
""
,
glue
(
", measures = c(\"{glue_collapse(input$richnessMeasures, sep='\", \"')}\")"
)
),
")\n"
,
"write.table(t, file = \"richness.tsv\", sep = \"\\t\", col.names = NA)"
)
})
...
...
@@ -565,6 +624,7 @@ shinyServer
})
output
$
richnessBUI
<-
renderUI
({
validate
(
need
(
data16S
(),
""
))
box
(
title
=
"Setting : "
,
width
=
NULL
,
...
...
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