Add option to penalize missing values

This commit is contained in:
Elias Projahn 2021-10-11 11:14:08 +02:00
parent 4222a08b87
commit c26e4ff4a3
2 changed files with 19 additions and 3 deletions

View file

@ -58,10 +58,22 @@ server <- function(input, output) {
results[, score := clusteriness_factor * clusteriness + results[, score := clusteriness_factor * clusteriness +
correlation_factor * correlation + neural_factor * neural] correlation_factor * correlation + neural_factor * neural]
# Apply the cut-off score & the required number of species. # Exclude genes with too few species.
results <- results[n_species >= input$n_species]
results <- results[n_species >= input$n_species & # Penalize missing species.
score >= input$cutoff / 100] if (input$penalize) {
species_count <- if (input$species == "all") {
nrow(species)
} else {
length(species_ids_replicative)
}
results <- results[, score := score * n_species / species_count]
}
# Apply the cut-off score.
results <- results[score >= input$cutoff / 100]
# Order the results based on their score. The resulting index will be # Order the results based on their score. The resulting index will be
# used as the "rank". # used as the "rank".

4
ui.R
View file

@ -57,6 +57,10 @@ ui <- fluidPage(
max = 100, max = 100,
step = 1, step = 1,
value = 50 value = 50
),
checkboxInput(
"penalize",
"Penalize missing values"
) )
), ),
wellPanel( wellPanel(