mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 19:27:24 +01:00
Add option to penalize missing values
This commit is contained in:
parent
4222a08b87
commit
c26e4ff4a3
2 changed files with 19 additions and 3 deletions
18
server.R
18
server.R
|
|
@ -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
4
ui.R
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue