Reintroduce mean expression as metric

This commit is contained in:
Elias Projahn 2022-06-06 15:56:34 +02:00
parent 0ee713a966
commit 882891da53
2 changed files with 17 additions and 2 deletions

View file

@ -2,11 +2,15 @@
#' @noRd #' @noRd
server <- function(input, output, session) { server <- function(input, output, session) {
ranked_data <- reactive({ ranked_data <- reactive({
total_weight <- abs(input$cross_sample_weight) + abs(input$sd_expression) total_weight <- abs(input$cross_sample_weight) +
abs(input$mean_expression) +
abs(input$sd_expression)
data <- data.table::copy(ubigen::genes) data <- data.table::copy(ubigen::genes)
data[, score := data[, score :=
(input$cross_sample_weight * get(input$cross_sample_metric) + (input$cross_sample_weight * get(input$cross_sample_metric) +
input$mean_expression * mean_expression_normalized +
input$sd_expression * sd_expression_normalized) / input$sd_expression * sd_expression_normalized) /
total_weight] total_weight]

13
R/ui.R
View file

@ -41,6 +41,17 @@ ui <- function() {
step = 0.01, step = 0.01,
value = 0.5 value = 0.5
), ),
sliderInput(
"mean_expression",
verticalLayout(
strong("Mean Expression"),
"Mean expression of the gene across all samples."
),
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.25
),
sliderInput( sliderInput(
"sd_expression", "sd_expression",
verticalLayout( verticalLayout(
@ -50,7 +61,7 @@ ui <- function() {
min = -1.0, min = -1.0,
max = 1.0, max = 1.0,
step = 0.01, step = 0.01,
value = -0.5 value = -0.25
) )
), ),
mainPanel( mainPanel(