From 375c5b27bafb0807da2bde9dc38d1a0c543095b7 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Fri, 16 Dec 2022 15:11:29 +0100 Subject: [PATCH] Add sample data to gene selector --- R/gene_selector.R | 35 +++++++++++++++++++++++++++++++++-- inst/content/help.md | 4 +++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/R/gene_selector.R b/R/gene_selector.R index 5c8d710..0bf108b 100644 --- a/R/gene_selector.R +++ b/R/gene_selector.R @@ -23,7 +23,8 @@ gene_selector_ui <- function(id) { choices = list( "Select from list" = "list", "Enter HGNC symbols" = "hgnc", - "Enter Ensembl gene IDs" = "ensembl" + "Enter Ensembl gene IDs" = "ensembl", + "Sample data: Glycolysis" = "sample" ) ), tabsetPanel( @@ -97,10 +98,40 @@ gene_selector_server <- function(id) { inputs <- unique(strsplit(input$hgnc_names_raw, "\\s+")[[1]]) inputs <- inputs[inputs != ""] ubigen::genes[hgnc_name %chin% inputs, gene] - } else { + } else if (input$identifier_type == "ensembl") { inputs <- unique(strsplit(input$gene_ids_raw, "\\s+")[[1]]) inputs <- inputs[inputs != ""] ubigen::genes[gene %chin% inputs, gene] + } else { + # Sample genes involved in glycolysis according to the KEGG pathways + # database [KEGG:hsa00010+M00001]. + c( + "ENSG00000111640", + "ENSG00000111669", + "ENSG00000149925", + "ENSG00000074800", + "ENSG00000105220", + "ENSG00000067225", + "ENSG00000102144", + "ENSG00000141959", + "ENSG00000156515", + "ENSG00000171314", + "ENSG00000067057", + "ENSG00000111674", + "ENSG00000159322", + "ENSG00000152556", + "ENSG00000109107", + "ENSG00000159399", + "ENSG00000108515", + "ENSG00000160883", + "ENSG00000226784", + "ENSG00000188316", + "ENSG00000106633", + "ENSG00000136872", + "ENSG00000156510", + "ENSG00000143627", + "ENSG00000170950" + ) } if (length(gene_ids) > 100) { diff --git a/inst/content/help.md b/inst/content/help.md index bfa7ac9..037497c 100644 --- a/inst/content/help.md +++ b/inst/content/help.md @@ -14,7 +14,9 @@ You can easily analyze your genes of interest for their ubiquity. In the initial state of the application, you can select genes by their HGNC symbols from a dropdown menu. To paste your genes as a whitespace separated list of either HGNC symbols or Ensembl gene IDs (in the form `ENSG00000164362`), change -the top dropdown from "Select from list" to the desired input method. +the top dropdown from "Select from list" to the desired input method. It is also +possible to select sample data (genes involved in glycolysis according to the +KEGG pathways database [`KEGG:hsa00010+M00001`]). ![Screenshot of the gene selector](gene_selector.png)