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
e6af8667
Commit
e6af8667
authored
Feb 14, 2020
by
Sandra Derozier
Browse files
Update ASV List
parent
20b20eeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/app_server.R
View file @
e6af8667
...
...
@@ -20,7 +20,12 @@ app_server <- function(input, output, session) {
dict
<-
all
$
otu_dictionary
affi
<-
all
$
affi
# Ambiguous ASVs and their affiliation
ambiguous_otu
<-
unique
(
affi
$
OTU
)
## this probably needs to be reactive
ambiguous_otu
<-
unique
(
affi
$
OTU
)
## Store cleaned otu as reactive values
otu
<-
reactiveValues
(
cleaned
=
ambiguous_otu
)
# Add ASV Select Input
insertUI
(
selector
=
"#tmp"
,
...
...
@@ -52,22 +57,26 @@ app_server <- function(input, output, session) {
"Current affiliation:"
,
paste
(
old_affiliations
[
input
$
asv
,
],
collapse
=
';'
),
"to be replaced with:"
,
paste
(
data
[
s
,
],
collapse
=
';'
),
paste
(
data
[
s
,
],
collapse
=
';'
),
sep
=
"\n"
)
}
})
## Replace affiliation upon confirmation
observeEvent
(
input
$
clean
,
{
s
=
input
$
table_rows_selected
if
(
length
(
s
))
{
## Update affiliations
affiliations
$
cleaned
[
input
$
asv
,
]
<-
unlist
(
data
[
s
,
])
## Update text (buggy, does not disappear when changing asv)
# output$selection <- renderUI({
# glue::glue("Updated affiliation of {input$asv} to\n",
# "{paste(affiliations$cleaned[input$asv, ], collapse = ';')}")
# })
# Update otu
otu
$
cleaned
<-
setdiff
(
otu
$
cleaned
,
input
$
asv
)
updateSelectInput
(
session
,
"asv"
,
label
=
"Select ASV"
,
choices
=
otu
$
cleaned
,
selected
=
tail
(
otu
$
cleaned
,
1
)
)
}
})
})
...
...
dev/run_dev.R
View file @
e6af8667
...
...
@@ -11,4 +11,4 @@ golem::detach_all_attached()
golem
::
document_and_reload
()
# Run the application
affiliationExplorer
::
run_app
()
affiliationExplorer
::
run_app
()
\ No newline at end of file
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