Skip to content

Commit

Permalink
Add export tables
Browse files Browse the repository at this point in the history
  • Loading branch information
aghozlane committed Jun 9, 2020
1 parent 287438d commit 5886bc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
redoofig.R
*.Rproj.user
*.Rhistory
*.RData
Expand Down
10 changes: 8 additions & 2 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,8 @@ shinyServer(function(input, output,session) {
if(!is.null(tree))
{
res = tabBox(width = NULL, selected = "Count table",
tabPanel("Count table",DT::dataTableOutput("DataCounts")),
tabPanel("Count table",DT::dataTableOutput("DataCounts"),
downloadButton('ExportRawCounts', 'Export count table file')),
tabPanel("Taxonomy",DT::dataTableOutput("DataTaxo"),
actionButton("deleteTaxo", "Delete annotation"),
downloadButton('ExportTaxo', 'Export taxonomy file')),
Expand All @@ -655,7 +656,8 @@ shinyServer(function(input, output,session) {
else
{
res = tabBox(width = NULL,selected = "Count table",
tabPanel("Count table",DT::dataTableOutput("DataCounts")),
tabPanel("Count table",DT::dataTableOutput("DataCounts"),
downloadButton('ExportRawCounts', 'Export count table file')),
tabPanel("Taxonomy",DT::dataTableOutput("DataTaxo"),
actionButton("deleteTaxo", "Delete annotation"),
downloadButton('ExportTaxo', 'Export taxonomy file')),
Expand Down Expand Up @@ -2307,6 +2309,10 @@ shinyServer(function(input, output,session) {
write_biom(make_biom(dataMergeCounts()$CT_noNorm, sample_metadata=values$TargetWorking[,-1],
observation_metadata=dataInput()$data$taxo_biom), file)}
)
output$ExportRawCounts <- downloadHandler(
filename = function() { 'SHAMAN_count.csv' },
content = function(file){write.csv(dataInput()$data$counts, file)}
)

output$ExportTaxo <- downloadHandler(
filename = function() { 'SHAMAN_taxo.csv' },
Expand Down

0 comments on commit 5886bc6

Please sign in to comment.