Skip to content

Commit

Permalink
First version of app to display atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
cpauvert committed May 19, 2021
1 parent b9a0921 commit ba5f60a
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
library(shiny)
library(dplyr)
library(magrittr)
library(DT)

if(!exists("mi_atlas")){
mi_atlas <- read.table("mi-atlas.tsv", header = TRUE, sep = "\t",
stringsAsFactors = FALSE, row.names = 1)
}

# Define UI
ui <- fluidPage(
lang = "en",
title = "mi-atlas",
fluidRow(column(width = 12, align = "center",
h1("An interactive and evolving microbial interactions catalog"))),
fluidRow(
column(
imageOutput("logo"),
align = "center", alt = "Logo of mi-atlas", width = 1),
column(width = 2),
column(width = 6,
h2("About", align = "center"),
p("Here is the list of interactions occuring between microorganisms that are documented",
"in the versioned catalog (see website).", "This classification is based on a framework",
"suggested by", a(href="https://doi.org/10.1093/femsle/fnz125",
target = "_blank", rel = "noreferrer noopener",
# open in new tab w/ protection
"(Pacheco and Segrè, 2019)."), align = "left"),
p("List of the microbial interactions in the catalog."),
helpText("Details on the column names can be found",
a(href="https://github.com/cpauvert/mi-atlas/blob/main/README.md#attributes-of-microbial-interactions",
target = "_blank", rel = "noreferrer noopener",
# open in new tab w/ protection
"here."))
),
column(width = 2),
column(align = "center", width = 1,
a(href="https://cpauvert.github.io/mi-atlas/framework.html",
target = "_blank", rel = "noreferrer noopener",
icon("book-open")), br(),
a(href="https://cpauvert.github.io/mi-atlas/framework.html",
target = "_blank", rel = "noreferrer noopener", "Framework"), br(),
a(href="https://cpauvert.github.io/mi-atlas",
target = "_blank", rel = "noreferrer noopener", icon("globe")), br(),
a(href="https://cpauvert.github.io/mi-atlas",
target = "_blank", rel = "noreferrer noopener", "Website"), br(),
a(href="https://github.com/cpauvert/mi-atlas/blob/main/CONTRIBUTING.md",
target = "_blank", rel = "noreferrer noopener", icon("github")), br(),
a(href="https://github.com/cpauvert/mi-atlas/blob/main/CONTRIBUTING.md",
target = "_blank", rel = "noreferrer noopener", "Contribute")
)
),
fluidRow(
column(width = 2),
column(width = 8, DT::dataTableOutput("table")),
column(width = 2)
)
)

# Define server logic
server <- function(input, output, session) {
output$logo <- renderImage({
list(src="docs/content/extra/logo.png",
# align="left", width="155", height="179",
align="left", width="77.5", height="89.5",
alt = "Logo of mi-atlas")
}, deleteFile = FALSE)
preview_atlas <- reactive({
mi_atlas %>% select(Interaction_name,
Participant_1, Participant_2, Participant_3)
})
output$table <- DT::renderDataTable(preview_atlas(),
extensions = 'Responsive',
selection = 'single',
options = list(
autoWidth = TRUE
)
)
output$wd<-renderText(getwd())
}

# Run the application
shinyApp(ui = ui, server = server)

0 comments on commit ba5f60a

Please sign in to comment.