Skip to content

Commit

Permalink
summarise -> summarize
Browse files Browse the repository at this point in the history
  • Loading branch information
Adafede committed Jan 23, 2025
1 parent 6d6238e commit d03e819
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 41 deletions.
10 changes: 5 additions & 5 deletions R/change_params_small.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @param ms_pol The polarity used. Must be either "pos" or "neg". STRING
#' @param org_tax If your experiment contains a single taxon, its scientific name. "Homo sapiens". STRING
#' @param hig_con Filter high confidence candidates only. BOOLEAN
#' @param summarise Summarize all candidates per feature to a single row. BOOLEAN
#' @param summarize Summarize all candidates per feature to a single row. BOOLEAN
#'
#' @export
#'
Expand All @@ -33,7 +33,7 @@
#' ms_pol = "pos",
#' org_tax = "Gentiana lutea",
#' hig_con = TRUE,
#' summarise = FALSE
#' summarize = FALSE
#' )
#' }
change_params_small <- function(fil_pat = NULL,
Expand All @@ -44,7 +44,7 @@ change_params_small <- function(fil_pat = NULL,
ms_pol = NULL,
org_tax = NULL,
hig_con = NULL,
summarise = NULL) {
summarize = NULL) {
tima:::go_to_cache()
paths_data_source <- tima:::get_default_paths()$data$source$path
paths_data_interim_annotations <-
Expand Down Expand Up @@ -113,8 +113,8 @@ change_params_small <- function(fil_pat = NULL,
if (!is.null(hig_con)) {
yaml_small$options$high_confidence <- hig_con
}
if (!is.null(summarise)) {
yaml_small$options$summarise <- summarise
if (!is.null(summarize)) {
yaml_small$options$summarize <- summarize
}

yaml::write_yaml(
Expand Down
6 changes: 3 additions & 3 deletions R/clean_chemo.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @param minimal_ms1_condition Condition to be used. Must be "OR" or "AND".
#' @param high_confidence Report high confidence candidates only. BOOLEAN
#' @param remove_ties Remove ties. BOOLEAN
#' @param summarise Boolean. summarise results (1 row per feature)
#' @param summarize Boolean. summarize results (1 row per feature)
#'
#' @return A table containing the chemically weighted annotation
#' where only a given number of initial candidates are kept
Expand All @@ -39,7 +39,7 @@ clean_chemo <-
minimal_ms1_condition = get("minimal_ms1_condition", envir = parent.frame()),
high_confidence = get("high_confidence", envir = parent.frame()),
remove_ties = get("remove_ties", envir = parent.frame()),
summarise = get("summarise", envir = parent.frame())) {
summarize = get("summarize", envir = parent.frame())) {
model <- tima:::columns_model()

log_debug(
Expand Down Expand Up @@ -186,7 +186,7 @@ clean_chemo <-
tidytable::distinct(c(feature_id, rank_final), .keep_all = TRUE)
}

if (summarise == TRUE) {
if (summarize == TRUE) {
log_debug("Collecting garbage ...")
gc()
log_debug("summarizing results \n")
Expand Down
4 changes: 2 additions & 2 deletions R/parse_cli_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ parse_cli_params <- function(arguments, parameters) {
if (!is.null(arguments$remove_ties)) {
parameters$options$remove_ties <- as.logical(arguments$remove_ties)
}
if (!is.null(arguments$summarise)) {
parameters$options$summarise <- as.logical(arguments$summarise)
if (!is.null(arguments$summarize)) {
parameters$options$summarize <- as.logical(arguments$summarize)
}
}
return(parameters)
Expand Down
6 changes: 3 additions & 3 deletions R/prepare_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ prepare_params <- function(params_small = get_params(step = "prepare_params"),
opt_hig_con <- params_advanced$options$high_confidence
opt_for <- params_advanced$options$force
opt_rem_tie <- params_advanced$options$remove_ties
opt_sum <- params_advanced$options$summarise
opt_sum <- params_advanced$options$summarize

log_debug(x = "Small params")
fil_pat <- params_small$files$pattern
Expand All @@ -181,7 +181,7 @@ prepare_params <- function(params_small = get_params(step = "prepare_params"),
ms_pol <- params_small$ms$polarity
org_tax <- params_small$organisms$taxon
opt_hig_con <- params_small$options$high_confidence
opt_sum <- params_small$options$summarise
opt_sum <- params_small$options$summarize

if (!is.null(org_tax)) {
if (org_tax == "") {
Expand Down Expand Up @@ -616,7 +616,7 @@ prepare_params <- function(params_small = get_params(step = "prepare_params"),
opt_hig_con
yamls_params$weight_annotations$options$remove_ties <-
opt_rem_tie
yamls_params$weight_annotations$options$summarise <-
yamls_params$weight_annotations$options$summarize <-
opt_sum
}
)
Expand Down
4 changes: 2 additions & 2 deletions R/weight_annotations.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
#' @param compounds_names Report compounds names. Can be very large. BOOLEAN
#' @param high_confidence Report high confidence candidates only. BOOLEAN
#' @param remove_ties Remove ties. BOOLEAN
#' @param summarise Summarize results (1 row per feature). BOOLEAN
#' @param summarize Summarize results (1 row per feature). BOOLEAN
#' @param pattern Pattern to identify your job. STRING
#'
#' @return The path to the weighted annotations
Expand Down Expand Up @@ -216,7 +216,7 @@ weight_annotations <- function(library = get_params(step = "weight_annotations")
compounds_names = get_params(step = "weight_annotations")$options$compounds_names,
high_confidence = get_params(step = "weight_annotations")$options$high_confidence,
remove_ties = get_params(step = "weight_annotations")$options$remove_ties,
summarise = get_params(step = "weight_annotations")$options$summarise,
summarize = get_params(step = "weight_annotations")$options$summarize,
pattern = get_params(step = "weight_annotations")$files$pattern,
force = get_params(step = "weight_annotations")$options$force) {
stopifnot("Annotations file(s) do(es) not exist" = all(purrr::map(.x = annotations, .f = file.exists) |> unlist()))
Expand Down
1 change: 0 additions & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@
}
}
],
"releaseNotes": "https://github.com/taxonomicallyinformedannotation/tima/blob/master/NEWS.md",
"readme": "https://github.com/taxonomicallyinformedannotation/tima/blob/main/README.md",
"contIntegration": ["https://github.com/taxonomicallyinformedannotation/tima/actions/workflows/R-CMD-check.yaml", "https://app.codecov.io/gh/taxonomicallyinformedannotation/tima"],
"developmentStatus": "https://lifecycle.r-lib.org/articles/stages.html#experimental"
Expand Down
4 changes: 2 additions & 2 deletions inst/_targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ list(
compounds_names = par_wei_ann$options$compounds_names,
high_confidence = par_wei_ann$options$high_confidence,
remove_ties = par_wei_ann$options$remove_ties,
summarise = par_wei_ann$options$summarise,
summarize = par_wei_ann$options$summarize,
pattern = par_wei_ann$files$pattern,
force = par_wei_ann$options$force
)
Expand Down Expand Up @@ -2662,7 +2662,7 @@ list(
compounds_names = benchmark_def_wei_ann$options$compounds_names,
high_confidence = FALSE,
remove_ties = benchmark_def_wei_ann$options$remove_ties,
summarise = benchmark_def_wei_ann$options$summarise,
summarize = benchmark_def_wei_ann$options$summarize,
pattern = benchmark_def_wei_ann$files$pattern,
force = benchmark_def_wei_ann$options$force
)
Expand Down
10 changes: 5 additions & 5 deletions inst/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -1538,8 +1538,8 @@ ui <- shiny::fluidPage(
)
),
shiny::checkboxInput(
inputId = "summarise",
label = "Summarise results to one row per feature",
inputId = "summarize",
label = "summarize results to one row per feature",
value = FALSE
) |>
shinyhelper::helper(
Expand Down Expand Up @@ -1828,7 +1828,7 @@ ui <- shiny::fluidPage(
}
hig_con <- shiny::isolate(input$high_confidence)
ms_pol <- shiny::isolate(input$ms_pol)
summarise <- shiny::isolate(input$summarise)
summarize <- shiny::isolate(input$summarize)

message(x = "Changing parameters ...")
message(x = "... Small")
Expand All @@ -1841,7 +1841,7 @@ ui <- shiny::fluidPage(
yaml_small$ms$polarity <- ms_pol
yaml_small$organisms$taxon <- org_tax
yaml_small$options$high_confidence <- hig_con
yaml_small$options$summarise <- summarise
yaml_small$options$summarize <- summarize
tima:::create_dir("params")
yaml::write_yaml(x = yaml_small, file = tima:::get_default_paths()$params$prepare_params)

Expand Down Expand Up @@ -2144,7 +2144,7 @@ ui <- shiny::fluidPage(
shiny::isolate(input$force)
yaml_advanced$options$remove_ties <-
shiny::isolate(input$remove_ties)
yaml_advanced$options$summarise <- summarise
yaml_advanced$options$summarize <- summarize

if (!is.null(prefil_met_raw)) {
yamls_params$prepare_taxa$files$metadata$raw <- fil_met_raw
Expand Down
4 changes: 2 additions & 2 deletions inst/params/default/weight_annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ options:
#' Remove ties. BOOLEAN
remove_ties: no

#' Summarise results to one row per feature. BOOLEAN
summarise: no
#' summarize results to one row per feature. BOOLEAN
summarize: no
2 changes: 1 addition & 1 deletion inst/params/prepare_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ options:
#' Filter high confidence candidates only. BOOLEAN
high_confidence: yes
#' Summarize all candidates per feature to a single row. BOOLEAN
summarise: no
summarize: no
2 changes: 1 addition & 1 deletion inst/params/prepare_params_advanced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,4 @@ options:
remove_ties: no

#' Summarize all candidates per feature to a single row. BOOLEAN
summarise: no
summarize: no
4 changes: 2 additions & 2 deletions inst/scripts/docopt/weight_annotations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ You can use this script with the following example:
Rscript inst/scripts/weight_annotations.R

Usage:
weight_annotations.R [--ann-can-fin=<ann-can-fin>] [--ann-ms1only=<ann-ms1only>] [--ann-thr-ms1-bio=<ann-thr-ms1-bio>] [--ann-thr-ms1-che=<ann-thr-ms1-che>] [--ann-thr-ms1-con=<ann-thr-ms1-con>] [--ann-thr-con=<ann-thr-con>] [--fil-ann-fil=<fil-ann-fil>] [--fil-ann-pre-can=<fil-ann-pre-can>] [--fil-ann-pre-for=<fil-ann-pre-for>] [--fil-ann-pro=<fil-ann-pro>] [--fil-lib-sop-mer=<fil-lib-sop-mer>] [--fil-net-spe-edg-pre=<fil-net-spe-edg-pre>] [--fil-met-pre=<fil-met-pre>] [--wei-glo-bio=<wei-glo-bio>] [--wei-glo-che=<wei-glo-che>] [--wei-glo-spe=<wei-glo-spe>] [--wei-bio-01=<wei-bio-01>] [--wei-bio-02=<wei-bio-02>] [--wei-bio-03=<wei-bio-03>] [--wei-bio-04=<wei-bio-04>] [--wei-bio-05=<wei-bio-05>] [--wei-bio-06=<wei-bio-06>] [--wei-bio-07=<wei-bio-07>] [--wei-bio-08=<wei-bio-08>] [--wei-bio-09=<wei-bio-09>] [--wei-bio-10=<wei-bio-10>] [--wei-bio-11=<wei-bio-11>] [--wei-bio-12=<wei-bio-12>] [--wei-bio-13=<wei-bio-13>] [--wei-bio-14=<wei-bio-14>] [--wei-bio-15=<wei-bio-15>] [--wei-che-11=<wei-che-11>] [--wei-che-12=<wei-che-12>] [--wei-che-13=<wei-che-13>] [--wei-che-14=<wei-che-14>] [--wei-che-21=<wei-che-21>] [--wei-che-22=<wei-che-22>] [--wei-che-23=<wei-che-23>] [--compounds-names=<compounds-names>] [--high-confidence=<high-confidence>] [--remove-ties=<remove-ties>] [--summarise=<summarise>] [--force=<force>]
weight_annotations.R [--ann-can-fin=<ann-can-fin>] [--ann-ms1only=<ann-ms1only>] [--ann-thr-ms1-bio=<ann-thr-ms1-bio>] [--ann-thr-ms1-che=<ann-thr-ms1-che>] [--ann-thr-ms1-con=<ann-thr-ms1-con>] [--ann-thr-con=<ann-thr-con>] [--fil-ann-fil=<fil-ann-fil>] [--fil-ann-pre-can=<fil-ann-pre-can>] [--fil-ann-pre-for=<fil-ann-pre-for>] [--fil-ann-pro=<fil-ann-pro>] [--fil-lib-sop-mer=<fil-lib-sop-mer>] [--fil-net-spe-edg-pre=<fil-net-spe-edg-pre>] [--fil-met-pre=<fil-met-pre>] [--wei-glo-bio=<wei-glo-bio>] [--wei-glo-che=<wei-glo-che>] [--wei-glo-spe=<wei-glo-spe>] [--wei-bio-01=<wei-bio-01>] [--wei-bio-02=<wei-bio-02>] [--wei-bio-03=<wei-bio-03>] [--wei-bio-04=<wei-bio-04>] [--wei-bio-05=<wei-bio-05>] [--wei-bio-06=<wei-bio-06>] [--wei-bio-07=<wei-bio-07>] [--wei-bio-08=<wei-bio-08>] [--wei-bio-09=<wei-bio-09>] [--wei-bio-10=<wei-bio-10>] [--wei-bio-11=<wei-bio-11>] [--wei-bio-12=<wei-bio-12>] [--wei-bio-13=<wei-bio-13>] [--wei-bio-14=<wei-bio-14>] [--wei-bio-15=<wei-bio-15>] [--wei-che-11=<wei-che-11>] [--wei-che-12=<wei-che-12>] [--wei-che-13=<wei-che-13>] [--wei-che-14=<wei-che-14>] [--wei-che-21=<wei-che-21>] [--wei-che-22=<wei-che-22>] [--wei-che-23=<wei-che-23>] [--compounds-names=<compounds-names>] [--high-confidence=<high-confidence>] [--remove-ties=<remove-ties>] [--summarize=<summarize>] [--force=<force>]

Arguments:
ann-can-fin Number of final candidates. INTEGER
Expand Down Expand Up @@ -52,7 +52,7 @@ Arguments:
force Do not use it. BOOLEAN
high-confidence Report high confidence candidates only. BOOLEAN
remove-ties Remove ties. BOOLEAN
summarise Summarize results (1 row per feature). BOOLEAN
summarize Summarize results (1 row per feature). BOOLEAN

Options:
-h --help Shows this screen.
Expand Down
6 changes: 3 additions & 3 deletions man/change_params_small.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/clean_chemo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/weight_annotations.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/shinytest2/001.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"org_tax": "",
"remove_ties": false,
"save": 1,
"summarise": false,
"summarize": false,
"targets-shiny-accordion": "Choose display",
"targets-shiny-degree_from": 8,
"targets-shiny-degree_to": 1,
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ test_that(desc = "Test functions", code = {
weight_annotations(
ms1_only = TRUE,
remove_ties = TRUE,
summarise = TRUE,
summarize = TRUE,
candidates_final = 1,
minimal_ms1_bio = 0.8,
minimal_ms1_condition = "AND",
Expand Down Expand Up @@ -542,7 +542,7 @@ test_that(desc = "Test functions", code = {
ms_pol = "pos",
org_tax = "Gentiana lutea",
hig_con = TRUE,
summarise = FALSE
summarize = FALSE
)

## CLI arguments check
Expand Down Expand Up @@ -679,7 +679,7 @@ test_that(desc = "Test functions", code = {
arguments$force <- TRUE
arguments$high_confidence <- TRUE
arguments$remove_ties <- TRUE
arguments$summarise <- TRUE
arguments$summarize <- TRUE

parse_cli_params(arguments = arguments, parameters = params)

Expand Down
2 changes: 1 addition & 1 deletion vignettes/tima.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ tima::change_params_small(
ms_pol = "pos",
org_tax = "Gentiana lutea",
hig_con = TRUE,
summarise = FALSE
summarize = FALSE
)
```

0 comments on commit d03e819

Please sign in to comment.