Reindent code to use just two spaces

This commit is contained in:
Elias Projahn 2022-05-26 12:44:09 +02:00
parent 47b8d7a1f0
commit 13b5efc1e3
10 changed files with 1000 additions and 999 deletions

View file

@ -7,63 +7,63 @@
#'
#' @noRd
preset_editor_ui <- function(id, options) {
species_choices <- c("All species", names(options$species_sets))
gene_choices <- names(options$gene_sets)
species_choices <- c("All species", names(options$species_sets))
gene_choices <- names(options$gene_sets)
if (!options$locked) {
species_choices <- c(species_choices, "Customize")
gene_choices <- c(gene_choices, "Customize")
}
verticalLayout(
h3("Inputs"),
selectInput(
NS(id, "species"),
"Species to include",
choices = species_choices
),
if (!options$locked) {
species_choices <- c(species_choices, "Customize")
gene_choices <- c(gene_choices, "Customize")
conditionalPanel(
condition = sprintf(
"input['%s'] == 'Customize'",
NS(id, "species")
),
selectizeInput(
inputId = NS(id, "custom_species"),
label = "Select input species",
choices = NULL,
multiple = TRUE
),
)
},
selectInput(
NS(id, "reference_genes"),
"Reference genes",
choices = gene_choices
),
if (!options$locked) {
conditionalPanel(
condition = sprintf(
"input['%s'] == 'Customize'",
NS(id, "reference_genes")
),
gene_selector_ui(NS(id, "custom_genes"))
)
},
if (options$locked) {
HTML(paste0(
"This instance prohibits performing custom analyses ",
"to reduce resource usage. Normally, it is possible ",
"to use this web application for analyzing any set of ",
"reference genes to find patterns in their ",
"chromosomal positions. If you would like to apply ",
"this method for your own research, see ",
"<a href=\"https://code.johrpan.de/johrpan/geposanui/src/",
"branch/main/README.md\" target=\"_blank\">this page</a> for ",
"more information."
))
}
verticalLayout(
h3("Inputs"),
selectInput(
NS(id, "species"),
"Species to include",
choices = species_choices
),
if (!options$locked) {
conditionalPanel(
condition = sprintf(
"input['%s'] == 'Customize'",
NS(id, "species")
),
selectizeInput(
inputId = NS(id, "custom_species"),
label = "Select input species",
choices = NULL,
multiple = TRUE
),
)
},
selectInput(
NS(id, "reference_genes"),
"Reference genes",
choices = gene_choices
),
if (!options$locked) {
conditionalPanel(
condition = sprintf(
"input['%s'] == 'Customize'",
NS(id, "reference_genes")
),
gene_selector_ui(NS(id, "custom_genes"))
)
},
if (options$locked) {
HTML(paste0(
"This instance prohibits performing custom analyses ",
"to reduce resource usage. Normally, it is possible ",
"to use this web application for analyzing any set of ",
"reference genes to find patterns in their ",
"chromosomal positions. If you would like to apply ",
"this method for your own research, see ",
"<a href=\"https://code.johrpan.de/johrpan/geposanui/src/",
"branch/main/README.md\" target=\"_blank\">this page</a> for ",
"more information."
))
}
)
)
}
#' Application logic for the preset editor.
@ -76,45 +76,45 @@ preset_editor_ui <- function(id, options) {
#'
#' @noRd
preset_editor_server <- function(id, options) {
moduleServer(id, function(input, output, session) {
custom_gene_ids <- if (!options$locked) {
species_choices <- geposan::species$id
names(species_choices) <- geposan::species$name
moduleServer(id, function(input, output, session) {
custom_gene_ids <- if (!options$locked) {
species_choices <- geposan::species$id
names(species_choices) <- geposan::species$name
updateSelectizeInput(
session,
"custom_species",
choices = species_choices,
server = TRUE
)
updateSelectizeInput(
session,
"custom_species",
choices = species_choices,
server = TRUE
)
gene_selector_server("custom_genes")
} else {
NULL
}
gene_selector_server("custom_genes")
} else {
NULL
}
reactive({
reference_gene_ids <- if (input$reference_genes == "Customize") {
custom_gene_ids()
} else {
options$gene_sets[[input$reference_genes]]
}
reactive({
reference_gene_ids <- if (input$reference_genes == "Customize") {
custom_gene_ids()
} else {
options$gene_sets[[input$reference_genes]]
}
species_ids <- if (input$species == "All species") {
geposan::species$id
} else if (input$species == "Customize") {
input$custom_species
} else {
options$species_sets[[input$species]]
}
species_ids <- if (input$species == "All species") {
geposan::species$id
} else if (input$species == "Customize") {
input$custom_species
} else {
options$species_sets[[input$species]]
}
tryCatch(
geposan::preset(
reference_gene_ids,
species_ids = species_ids
),
error = function(err) NULL
)
})
tryCatch(
geposan::preset(
reference_gene_ids,
species_ids = species_ids
),
error = function(err) NULL
)
})
})
}