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
Cedric Midoux
Easy16S
Commits
8e7823c5
Commit
8e7823c5
authored
Apr 07, 2021
by
mahendra-mariadassou
Browse files
Add anova module for alpha diversity
parent
cdd02021
Changes
3
Hide whitespace changes
Inline
Side-by-side
panels/richnessA-server.R
View file @
8e7823c5
...
...
@@ -62,15 +62,15 @@ output$alphaPlotUI <- renderUI({
output
$
alphaPlot
<-
metaRender2
(
renderPlot
,
{
validate
(
need
(
physeq
(),
"Requires an abundance dataset"
))
data
<-
physeq
()
alphaPlot_boxplot
<-
if
(
input
$
richnessBoxplot
>=
2
)
{
metaExpr
({
geom_boxplot
()})
}
alphaPlot_point
<-
if
(
input
$
richnessBoxplot
<=
2
)
{
metaExpr
({
geom_point
()})
}
metaExpr
({
p
<-
plot_richness
(
physeq
=
data
,
...
...
@@ -106,3 +106,47 @@ output$alphaTable <- renderUI({
beautifulTable
(
tibble
::
rownames_to_column
(
round
(
estimate_richness
(
physeq
()),
digits
=
2
),
var
=
"SAMPLE"
))
)
})
output
$
alphaAnovaUI
<-
renderUI
({
validate
(
need
(
physeq
(),
"Requires an abundance dataset"
))
box
(
title
=
"Alpha diversity Anova analysis"
,
width
=
NULL
,
status
=
"primary"
,
selectInput
(
inputId
=
"anovaRichnessMeasure"
,
label
=
"Richness measure : "
,
choices
=
c
(
"Observed"
,
"Chao1"
,
"ACE"
,
"Shannon"
,
"Simpson"
,
"InvSimpson"
,
"Fisher"
),
selected
=
"Observed"
,
multiple
=
FALSE
),
selectInput
(
inputId
=
"anovaCovariate"
,
label
=
"Covariate : "
,
choices
=
c
(
sample_variables
(
physeq
()))
)
)
})
output
$
alphaAnova
<-
renderPrint
({
validate
(
need
(
physeq
(),
"Requires an abundance dataset"
),
need
(
input
$
anovaRichnessMeasure
,
""
),
need
(
input
$
anovaCovariate
,
"Select a covariate"
)
)
anova_data
<-
cbind
(
estimate_richness
(
physeq
(),
measures
=
input
$
anovaRichnessMeasure
),
as
(
sample_data
(
physeq
()),
"data.frame"
))
formula
<-
paste0
(
input
$
anovaRichnessMeasure
,
" ~ "
,
input
$
anovaCovariate
)
model
<-
do.call
(
"lm"
,
list
(
formula
=
as.formula
(
formula
),
data
=
as.name
(
"anova_data"
)))
print
(
model
)
anova
(
model
)
})
panels/richnessA-ui.R
View file @
8e7823c5
alphaPlot
<-
fluidPage
(
outputCodeButton
(
withLoader
(
plotOutput
(
"alphaPlot"
,
height
=
700
))),
uiOutput
(
"alphaPlotUI"
))
alphaTable
<-
fluidPage
(
uiOutput
(
"alphaTable"
))
alphaAnova
<-
fluidPage
(
uiOutput
(
"alphaAnovaUI"
),
verbatimTextOutput
(
"alphaAnova"
)
)
ui.R
View file @
8e7823c5
...
...
@@ -17,18 +17,18 @@ source("panels/Help-ui.R", local = TRUE)
shinyUI
(
dashboardPage
(
dashboardHeader
(
title
=
"Easy16S"
),
dashboardSidebar
(
actionButton
(
"dataButton"
,
"Select your data"
,
actionButton
(
"dataButton"
,
"Select your data"
,
icon
=
icon
(
"upload"
),
width
=
200
),
actionButton
(
"filterButton"
,
actionButton
(
"filterButton"
,
"Select some samples"
,
icon
=
icon
(
"filter"
),
width
=
200
),
actionButton
(
"transformButton"
,
"Transform abundance"
,
actionButton
(
"transformButton"
,
"Transform abundance"
,
icon
=
icon
(
"square-root-alt"
),
width
=
200
),
...
...
@@ -39,13 +39,13 @@ dashboardHeader(title = "Easy16S"),
size
=
"mini"
,
width
=
200
),
actionButton
(
"downloadButton"
,
"Download data"
,
actionButton
(
"downloadButton"
,
"Download data"
,
icon
=
icon
(
"download"
),
width
=
200
),
actionButton
(
"plotButton"
,
"Download last plot"
,
actionButton
(
"plotButton"
,
"Download last plot"
,
icon
=
icon
(
"file-image"
),
width
=
200
),
...
...
@@ -62,7 +62,8 @@ dashboardHeader(title = "Easy16S"),
menuItem
(
"Rarefaction curves"
,
tabName
=
"rarefactionCurve"
,
icon
=
icon
(
"chart-line"
)),
menuItem
(
HTML
(
"α-diversity"
),
icon
=
icon
(
"th"
),
menuSubItem
(
"Plots"
,
tabName
=
"alphaPlot"
),
menuSubItem
(
"Table"
,
tabName
=
"alphaTable"
)
menuSubItem
(
"Table"
,
tabName
=
"alphaTable"
),
menuSubItem
(
"ANOVA"
,
tabName
=
"alphaAnova"
)
),
menuItem
(
HTML
(
"β-diversity"
),
icon
=
icon
(
"th"
),
selectInput
(
"betaDistance"
,
...
...
@@ -92,6 +93,7 @@ dashboardHeader(title = "Easy16S"),
tabItem
(
tabName
=
"rarefactionCurve"
,
rarefactionCurve
),
tabItem
(
tabName
=
"alphaPlot"
,
alphaPlot
),
tabItem
(
tabName
=
"alphaTable"
,
alphaTable
),
tabItem
(
tabName
=
"alphaAnova"
,
alphaAnova
),
tabItem
(
tabName
=
"betaMds"
,
betaMds
),
tabItem
(
tabName
=
"betaCluster"
,
betaCluster
),
tabItem
(
tabName
=
"betaManova"
,
betaManova
),
...
...
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