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
migale
affiliationExplorer
Commits
49b2af41
Commit
49b2af41
authored
Feb 18, 2020
by
mahendra-mariadassou
Browse files
Merge branch 'master' of forgemia.inra.fr:migale/affiliationexplorer
parents
f80803a2
5c182bbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/app_server.R
View file @
49b2af41
...
...
@@ -12,12 +12,14 @@ app_server <- function(input, output, session) {
# List the first level callModules here
shinyjs
::
hide
(
"clean"
)
shinyjs
::
hide
(
"skip"
)
shinyjs
::
hide
(
"download"
)
output
$
tmptxt
<-
renderUI
(
"
Please upload your data (Biom file and MultiHits TSV file)."
)
output
$
tmptxt
<-
renderUI
(
HTML
(
"<p>
Please upload your data (Biom file and MultiHits TSV file).
</p>
"
)
)
observeEvent
(
input
$
tsv
,
{
shinyjs
::
show
(
"clean"
)
shinyjs
::
show
(
"skip"
)
shinyjs
::
show
(
"download"
)
output
$
tmptxt
<-
renderUI
(
""
)
...
...
@@ -52,7 +54,7 @@ app_server <- function(input, output, session) {
# Extract Affiliation for a given OTU
data
$
affi
<-
extract_affiliation
(
affi
,
input
$
asv
)
%>%
dplyr
::
distinct
()
amb
<-
find_level
(
data
$
affi
)
output
$
txt
<-
renderUI
({
paste
(
input
$
asv
,
"- "
,
nrow
(
data
$
affi
)
,
"conflicting affiliation, ambiguity at rank "
,
amb
)})
output
$
txt
<-
renderUI
(
HTML
(
{
paste
(
"<p><b>"
,
input
$
asv
,
"- "
,
nrow
(
data
$
affi
)
,
"conflicting affiliation, ambiguity at rank "
,
amb
,
"</b></p>"
)})
)
output
$
table
<-
DT
::
renderDT
({
data
$
affi
},
selection
=
list
(
mode
=
'single'
,
selected
=
NULL
,
target
=
'row'
),
editable
=
TRUE
)
...
...
@@ -60,12 +62,12 @@ app_server <- function(input, output, session) {
output
$
selection
<-
renderUI
({
s
=
input
$
table_rows_selected
if
(
length
(
s
))
{
paste
(
"
Current affiliation:
"
,
paste
(
data
$
cleaned
[
input
$
asv
,
],
collapse
=
'
;
'
),
"
to be replaced with:"
,
paste
(
data
$
affi
[
s
,
],
collapse
=
'
;
'
)
,
sep
=
"\n"
)
HTML
(
paste
(
"<b>
Current affiliation:
</b><br/> "
)
,
paste
(
data
$
cleaned
[
input
$
asv
,
],
collapse
=
'
/
'
),
"<br/><b>
to be replaced with:
</b><br/>
"
,
paste
(
data
$
affi
[
s
,
],
collapse
=
'
/
'
)
)
}
})
})
...
...
@@ -88,7 +90,21 @@ app_server <- function(input, output, session) {
selected
=
data
$
amb_otus
[
1
]
)
}
})
}
)
## Skip ASV
observeEvent
(
input
$
skip
,
{
data
$
amb_otus
<-
setdiff
(
data
$
amb_otus
,
input
$
asv
)
updateSelectInput
(
session
,
"asv"
,
label
=
"Select ASV"
,
choices
=
data
$
amb_otus
,
selected
=
data
$
amb_otus
[
1
]
)
}
)
output
$
download
<-
downloadHandler
(
filename
=
function
()
{
...
...
R/app_ui.R
View file @
49b2af41
...
...
@@ -37,10 +37,11 @@ app_ui <- function() {
htmlOutput
(
"txt"
),
HTML
(
"<br/>"
),
DT
::
DTOutput
(
"table"
),
HTML
(
"<br/>"
),
#
HTML("<br/>"),
htmlOutput
(
"selection"
),
HTML
(
"<br/>"
),
actionButton
(
"clean"
,
"Clean ASV"
),
actionButton
(
"skip"
,
"Skip ASV"
),
downloadButton
(
"download"
,
"Download"
)
)
)
...
...
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