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
e360142a
Commit
e360142a
authored
Mar 23, 2021
by
mahendra-mariadassou
Browse files
Preserve OTU additional metadata (seed_id, comment, etc) present in the original biom.
parent
3467d94d
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/app_server.R
View file @
e360142a
...
...
@@ -34,6 +34,8 @@ app_server <- function(input, output, session) {
# Read the biom file --> phyloseq
biomfile
<-
read_frogs_biom
(
input
$
biom
$
datapath
)
# read the cluster metadata --> list
otu_metadata
<-
read_biom_rows
(
input
$
biom
$
datapath
)
# Read the optional fasta file --> read_fasta
fasta
<-
read_fasta
(
input
$
fasta
$
datapath
)
# Read the tsv file --> readr
...
...
@@ -126,7 +128,7 @@ app_server <- function(input, output, session) {
observeEvent
(
input
$
clean
,
{
s
=
input
$
table_rows_selected
if
(
length
(
s
))
{
## Update affiliations
## Update affiliations
in tabular data
data
$
cleaned
[
input
$
asv
,
]
<-
unlist
(
remove_extra
(
data
$
affi
)[
s
,
])
data
$
amb_otus
<-
setdiff
(
data
$
amb_otus
,
input
$
asv
)
updateSelectInput
(
session
,
"asv"
,
...
...
@@ -169,7 +171,8 @@ app_server <- function(input, output, session) {
phyloseq.extended
::
write_phyloseq
(
physeq
=
physeq
,
biom_file
=
con
,
biom_format
=
"frogs"
biom_format
=
"frogs"
,
rows_metadata
=
otu_metadata
)
})
...
...
R/utils.R
View file @
e360142a
...
...
@@ -3,6 +3,11 @@ read_frogs_biom <- function(biom_file) {
phyloseq.extended
::
import_frogs
(
biom_file
)
}
## Template for reading OTU metadata
read_biom_rows
<-
function
(
biom_file
)
{
rows
<-
biomformat
::
read_biom
(
biom_file
)
$
rows
}
## Template for reading tsv files
read_multihits
<-
function
(
multihits_file
)
{
readr
::
read_tsv
(
multihits_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