mirror of
https://github.com/johrpan/ubigen.git
synced 2025-10-26 19:57:24 +01:00
Allow selecting the expression dataset
This commit is contained in:
parent
2f24812c90
commit
510fafeb6e
15 changed files with 110 additions and 57 deletions
9
R/data.R
9
R/data.R
|
|
@ -1,2 +1,9 @@
|
|||
#' A `data.table` containig data on genes and their expression behavior.
|
||||
#' A `data.table` containig mappings of Ensembl gene ID to HGNC symbol.
|
||||
"genes"
|
||||
|
||||
#' The results from the analysis across all GTEx samples.
|
||||
"gtex_all"
|
||||
|
||||
#' The results from the analysis across Human Protein Atlas' tissue aggregated
|
||||
#' data.
|
||||
"hpa_tissues"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#' percentiles for each gene.
|
||||
#'
|
||||
#' @export
|
||||
rank_genes <- function(data = ubigen::genes,
|
||||
rank_genes <- function(data = ubigen::gtex_all,
|
||||
cross_sample_metric = "above_95",
|
||||
cross_sample_weight = 0.5,
|
||||
level_metric = "median_expression_normalized",
|
||||
|
|
|
|||
11
R/server.R
11
R/server.R
|
|
@ -1,8 +1,19 @@
|
|||
#' Server implementing the main user interface.
|
||||
#' @noRd
|
||||
server <- function(input, output, session) {
|
||||
dataset <- reactive({
|
||||
analysis <- if (input$dataset == "hpa_tissues") {
|
||||
ubigen::hpa_tissues
|
||||
} else {
|
||||
ubigen::gtex_all
|
||||
}
|
||||
|
||||
merge(analysis, ubigen::genes, by = "gene")
|
||||
})
|
||||
|
||||
ranked_data <- reactive({
|
||||
rank_genes(
|
||||
data = dataset(),
|
||||
cross_sample_metric = input$cross_sample_metric,
|
||||
cross_sample_weight = input$cross_sample_weight,
|
||||
level_metric = input$level_metric,
|
||||
|
|
|
|||
8
R/ui.R
8
R/ui.R
|
|
@ -19,6 +19,14 @@ ui <- function() {
|
|||
h3("Your genes"),
|
||||
gene_selector_ui("custom_genes"),
|
||||
h3("Method"),
|
||||
selectInput(
|
||||
"dataset",
|
||||
label = strong("Expression dataset"),
|
||||
list(
|
||||
"GTEx (all samples)" = "gtex_all",
|
||||
"Human Protein Atlas (tissues)" = "hpa_tissues"
|
||||
)
|
||||
),
|
||||
selectInput(
|
||||
"cross_sample_metric",
|
||||
verticalLayout(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue