mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
Add buttons to copy results
This commit is contained in:
parent
686af3f44b
commit
ae0643741a
2 changed files with 34 additions and 0 deletions
28
server.R
28
server.R
|
|
@ -2,6 +2,7 @@ library(data.table)
|
||||||
library(DT)
|
library(DT)
|
||||||
library(gprofiler2)
|
library(gprofiler2)
|
||||||
library(plotly)
|
library(plotly)
|
||||||
|
library(rclipboard)
|
||||||
library(shiny)
|
library(shiny)
|
||||||
|
|
||||||
source("init.R")
|
source("init.R")
|
||||||
|
|
@ -100,6 +101,33 @@ server <- function(input, output) {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
output$copy <- renderUI({
|
||||||
|
results <- results()
|
||||||
|
|
||||||
|
gene_ids <- results[, gene]
|
||||||
|
names <- results[name != "", name]
|
||||||
|
|
||||||
|
genes_text <- paste(gene_ids, collapse = "\n")
|
||||||
|
names_text <- paste(names, collapse = "\n")
|
||||||
|
|
||||||
|
splitLayout(
|
||||||
|
rclipButton(
|
||||||
|
"copy_ids_button",
|
||||||
|
"Copy gene IDs",
|
||||||
|
genes_text,
|
||||||
|
icon = icon("clipboard"),
|
||||||
|
width = "100%"
|
||||||
|
),
|
||||||
|
rclipButton(
|
||||||
|
"copy_names_button",
|
||||||
|
"Copy gene names",
|
||||||
|
names_text,
|
||||||
|
icon = icon("clipboard"),
|
||||||
|
width = "100%"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
output$scatter <- renderPlot({
|
output$scatter <- renderPlot({
|
||||||
results <- results()
|
results <- results()
|
||||||
|
|
||||||
|
|
|
||||||
6
ui.R
6
ui.R
|
|
@ -1,8 +1,10 @@
|
||||||
library(DT)
|
library(DT)
|
||||||
library(plotly)
|
library(plotly)
|
||||||
|
library(rclipboard)
|
||||||
library(shiny)
|
library(shiny)
|
||||||
|
|
||||||
ui <- fluidPage(
|
ui <- fluidPage(
|
||||||
|
rclipboardSetup(),
|
||||||
titlePanel("TPE-OLD candidates"),
|
titlePanel("TPE-OLD candidates"),
|
||||||
column(
|
column(
|
||||||
width = 3,
|
width = 3,
|
||||||
|
|
@ -59,6 +61,10 @@ ui <- fluidPage(
|
||||||
wellPanel(
|
wellPanel(
|
||||||
h3("Results"),
|
h3("Results"),
|
||||||
textOutput("synposis"),
|
textOutput("synposis"),
|
||||||
|
div(
|
||||||
|
style = "margin-top: 16px",
|
||||||
|
uiOutput("copy")
|
||||||
|
),
|
||||||
div(
|
div(
|
||||||
style = "overflow-x: auto; overflow-y: auto; margin-top: 16px",
|
style = "overflow-x: auto; overflow-y: auto; margin-top: 16px",
|
||||||
DTOutput("genes")
|
DTOutput("genes")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue