Include more features

This commit is contained in:
Elias Projahn 2022-05-12 13:03:13 +02:00
parent c9b26cc823
commit b4d758ff03
2 changed files with 60 additions and 8 deletions

View file

@ -2,14 +2,18 @@
#' @noRd #' @noRd
server <- function(input, output) { server <- function(input, output) {
ranked_data <- reactive({ ranked_data <- reactive({
total_weight <- abs(input$above_median) + total_weight <- abs(input$above_zero) +
abs(input$above_median) +
abs(input$above_95) +
abs(input$mean_expression) + abs(input$mean_expression) +
abs(input$sd_expression) abs(input$sd_expression)
data <- data.table::copy(ubigen::genes) data <- data.table::copy(ubigen::genes)
data[, score := data[, score :=
(input$above_median * above_median + (input$above_zero * above_zero +
input$above_95 * above_95 +
input$above_median * above_median +
input$mean_expression * mean_expression_normalized + input$mean_expression * mean_expression_normalized +
input$sd_expression * sd_expression_normalized) / input$sd_expression * sd_expression_normalized) /
total_weight] total_weight]

60
R/ui.R
View file

@ -13,18 +13,60 @@ ui <- function() {
sidebarLayout( sidebarLayout(
sidebarPanel( sidebarPanel(
width = 3, width = 3,
h3("Criteria"), h3("Features"),
sliderInput( sliderInput(
"above_median", "above_zero",
"Expressed above median", verticalLayout(
strong("Expressed"),
paste0(
"Percentage of samples in which the gene is ",
"expressed."
)
),
min = -1.0, min = -1.0,
max = 1.0, max = 1.0,
step = 0.01, step = 0.01,
value = 1.0 value = 0.33
),
sliderInput(
"above_median",
verticalLayout(
strong("Expressed above median"),
paste0(
"Percentage of samples that express the gene ",
"more than the median of expression within ",
"that sample."
)
),
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.33
),
sliderInput(
"above_95",
verticalLayout(
strong("Expressed above 95%"),
paste0(
"Percentage of samples that express the gene ",
"more than the 95. percentile of expression ",
"within that sample."
)
),
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.33
), ),
sliderInput( sliderInput(
"mean_expression", "mean_expression",
"Mean expression", verticalLayout(
strong("Mean expression"),
div(paste0(
"Average of the gene's expression across all ",
"samples."
))
),
min = -1.0, min = -1.0,
max = 1.0, max = 1.0,
step = 0.01, step = 0.01,
@ -32,7 +74,13 @@ ui <- function() {
), ),
sliderInput( sliderInput(
"sd_expression", "sd_expression",
"Standard deviation", verticalLayout(
strong("Standard deviation"),
paste0(
"Standard deviation of the gene's expression ",
"across all samples."
)
),
min = -1.0, min = -1.0,
max = 1.0, max = 1.0,
step = 0.01, step = 0.01,