Commit Graph
68 Commits
Author SHA1 Message Date
dr. M.S. (Matthijs) Berends 30021a9831 (v3.0.1.9153) Speed up mdro(), as.sir(), wisca() and wisca_plot() and the binding of mo vectors, fix PDR in the CMI 2012 guideline of mdro() being assigned to the wrong rows, and limit the stratified WISCA example to the 5 most common species 2026-10-16 06:08:26 +02:00
dr. M.S. (Matthijs) Berends 0efc8826c8 Let aggregated analyses follow the guideline for the 'I' category in count_df(), proportion_df(), sir_df(), the plotting functions, antibiogram(), wisca(), and bug_drug_combinations(), deprecate combine_SI in favour of guideline, fix format() on bug_drug_combinations() counting I as resistant, and add a shared section 'Interpretation of SIR' 2026-10-15 09:58:21 +02:00
dr. M.S. (Matthijs) Berends bf12e3abe7 (v3.0.1.9123) Add method argument to sir_combine() for resistance within a group (most_resistant), and restore the AMR 3.0.1 behaviour of count_*() and proportion_*() for multiple antimicrobials (#321) 2026-10-12 21:37:13 +02:00
dr. M.S. (Matthijs) Berends 0293d296aa (v3.0.1.9121) styler 2026-10-12 11:42:06 +02:00
dr. M.S. (Matthijs) Berends 36e6388868 (v3.0.1.9118) update doc 2026-10-11 22:32:15 +02:00
dr. M.S. (Matthijs) Berends 53d0704271 (v3.0.1.9116) New sir_combine() for combination therapy as one engine for antibiogram(), wisca(), count_*() and proportion_*() (#321), and make all suggested packages runtime-only with a new CI workflow without dplyr
- New sir_combine() to combine SIR results of multiple antimicrobials into one variable; antibiogram(), wisca() and the count/proportion functions now use the same engine (antibiogram() and wisca() output unchanged)
- With multiple antimicrobials, count_*() and proportion_*() now follow the documented combination therapy rules: resistance() is the proportion of failing combinations, count_all() excludes isolates with an unknown combination result, and WT/NWT/NS/NI are handled correctly
- where() is now decided at runtime instead of at installation, fixing antibiogram() and wisca() without tidyselect (e.g. CRAN binaries without dplyr)
- Imports from data.table and cli moved to .onLoad(); data.table functions are only used while it is loaded; the like() example no longer unloads data.table, which crashed R
- Static test that fails on code outside functions depending on suggested packages
- New check-without-dplyr workflow: installs AMR with all suggested packages, removes dplyr (and tidyselect), then runs all unit tests and examples against the installed package
- g.test() now returns the degrees of freedom as 'parameter', so they are printed
- Fix R CMD check NOTEs (hidden .claude folder, lost braces in inherited g.test and ggplot_pca docs)
2026-10-11 20:36:31 +02:00
dr. M.S. (Matthijs) Berends 9e609dae83 (v3.0.1.9114) Fix errors without cli and on R 3.0, and make the tinytest pipeline actually run the unit tests
Package:
- stop_() called cli::ansi_has_hyperlink_support() before checking that cli is available, so without cli every error became "there is no package called 'cli'"
- interpretive_rules() failed on R 3.0 for guidelines without AmpC rules (assignment to zero rows)
- Guard the ggplot2 example of wisca_plot()

CI:
- check-old: R 3.0 could not install tinytest over HTTPS, so no unit tests ran; install it with curl, and fail when tinytest is missing or any test fails
- tinytest shim: record expectations in the test file environment, support skips and errors per test_that() block, add missing testthat equivalents, source helper files
- Add R 4.0 (oldrel-6) to check-old, and oldrel-5 to check-recent
2026-10-10 14:54:15 +02:00
dr. M.S. (Matthijs) Berends bbdd3a92e2 (v3.0.1.9088) add version number to intrinsic_resistant 2026-09-03 12:14:25 +02:00
dr. M.S. (Matthijs) Berends 0c1709c999 (v3.0.1.9061) WISCA refix 2026-06-23 19:43:54 +02:00
dr. M.S. (Matthijs) Berends fd90b2c250 (v3.0.1.9060) WISCA fix 2026-06-23 19:27:40 +02:00
dr. M.S. (Matthijs) Berends 9898b5df4b (v3.0.1.9059) Fix WISCA in vignette 2026-06-23 14:38:59 +02:00
Matthijs Berends 3f9f931777 (v3.0.1.9059) Update taxonomy of microorganisms 2026-06-23 01:38:13 +02:00
dr. M.S. (Matthijs) Berends 0af3f84655 (v3.0.1.9057) website fix 2026-05-02 14:56:26 +02:00
Matthijs BerendsandClaude f7e9294bea Add parallel computing support to antibiogram() and wisca() (#281) (#282)
* Add parallel computing support to antibiogram() and wisca() (#281)

For WISCA: simulations are distributed across (group, chunk) job pairs
via future.apply::future_lapply(), keeping all workers active even when
the regimen count is smaller than nbrOfWorkers(). Sequential fallback
with progress ticker is preserved when parallel = FALSE or workers = 1.

For grouped antibiograms: each group is processed by a separate worker,
mirroring the row-batch approach in as.sir().

Same gate pattern as as.sir() (PR #280): requires a non-sequential
future::plan() to be active; auto-upgrades to parallel = TRUE when a
parallel plan is detected; throws an informative error otherwise.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF

* Fix version to 3.0.1.9055 and update CLAUDE.md version formula

Uses origin/${defaultbranch} (with a fetch) instead of the local
branch ref so the commit count is never stale after a merge.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF

* Fix non-ASCII characters in antibiogram.R

Replace en/em dashes and non-breaking spaces with ASCII equivalents
to satisfy R CMD check portability requirement.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF

* Update auto-generated Rd files after documentation rebuild

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF

* Move parallel gate to top of antibiogram.default() like sir.R

The gate was inside the wisca==TRUE block, so parallel=TRUE with a
sequential plan was silently ignored for non-WISCA antibiograms.
Now the gate runs unconditionally at the top of the function,
identical to the as.sir() pattern: error on explicit parallel=TRUE
with sequential plan, auto-upgrade when a non-sequential plan is
already active.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF

* Fix parallel WISCA returning all NA; strengthen tests; add sequential hint

Bug: lapply() over a factor yields length-1 factor elements (integer
codes), while for() over a factor yields character strings.  The job
list stored j\$group as a factor integer, but the reassembly loop
compared it with identical(j\$group, g) where g was character -- always
FALSE, so no simulation chunks were ever assembled and coverage stayed
NA throughout.

Fix: convert unique_groups to character before building jobs so both
the job list and the reassembly loop use the same type.

Tests: replaced na.rm = TRUE guards with explicit anyNA() checks so the
test suite would have caught the all-NA result immediately.

Also adds a sequential-mode performance hint (analogous to sir.R
lines 1116-1127) when simulations >= 500 and >= 3 regimens.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-30 18:41:56 +01:00
Matthijs Berends 8ff5d4472a Add add_if_missing parameter to control NA handling in interpretive rules (#264) 2026-04-21 21:53:43 +02:00
dr. M.S. (Matthijs) Berends 26613d774b (v3.0.1.9042) add EUCAST breakpoint table v16 to interpretive_rules() 2026-04-02 11:42:19 +02:00
dr. M.S. (Matthijs) Berends ba4c159154 (v3.0.1.9019) Wildtype/Non-wildtype support, and start with interpretive_rules()
Fixes #246
Fixes #254
Fixes #255
Fixes #256
2026-02-08 23:15:40 +01:00
dr. M.S. (Matthijs) Berends 151af21f38 (v3.0.1.9005) re-add tidymodels implementation 2025-12-21 12:19:43 +01:00
dr. M.S. (Matthijs) Berends 753f0e1ef9 (v3.0.0.9001) the first fixes 2025-06-04 13:10:20 +02:00
dr. M.S. (Matthijs) Berends 1710e220dd AMR v3.0\! 2025-06-02 12:11:00 +02:00
dr. M.S. (Matthijs) Berends 2461631bce (v2.1.1.9268) WISCA vignette, antibiogram sorting, fix translations 2025-05-01 14:45:21 +02:00
github-actions[bot] c70ac149ff new WISCA vignette 2025-04-30 17:33:03 +02:00
dr. M.S. (Matthijs) Berends 579025f678 (v2.1.1.9241) fix sir 2025-04-18 13:25:59 +02:00
dr. M.S. (Matthijs) Berends cf91e677c6 (v2.1.1.9240) fix sir interpretation 2025-04-16 15:22:12 +02:00
dr. M.S. (Matthijs) Berends a905303296 (v2.1.1.9234) fix CLSI 2025-04-07 17:36:01 +01:00
dr. M.S. (Matthijs) Berends 1fdab84103 (v2.1.1.9233) chore: make all argument texts full sentences 2025-03-31 14:53:24 +02:00
dr. M.S. (Matthijs) Berends 63099cd81e (v2.1.1.9232) is.mic() iteration, documentation cleanup 2025-03-31 10:51:31 +02:00
dr. M.S. (Matthijs) Berends bb110646db (v2.1.1.9223) allow + ab 2025-03-20 22:56:32 +01:00
dr. M.S. (Matthijs) Berends 287e361a54 (v2.1.1.9218) Fix unit tests 2025-03-19 16:05:24 +01:00
dr. M.S. (Matthijs) Berends 4dc4398ad1 (v2.1.1.9217) allow + in amr selectors 2025-03-18 16:35:22 +01:00
dr. M.S. (Matthijs) Berends a2c2be23c1 (v2.1.1.9190) antibiotics deprecation in antibiogram() 2025-03-09 10:41:11 +01:00
dr. M.S. (Matthijs) Berends f7938289eb (v2.1.1.9186) replace antibiotics with antimicrobials! 2025-03-07 20:43:26 +01:00
dr. M.S. (Matthijs) Berends 07efc292bc (v2.1.1.9163) cleanup 2025-02-27 14:04:29 +01:00
dr. M.S. (Matthijs) Berends ef02f4a7f2 (v2.1.1.9151) update readme 2025-02-15 20:53:12 +01:00
dr. M.S. (Matthijs) Berends 9650545d6e (v2.1.1.9150) unit tests 2025-02-15 13:40:51 +01:00
dr. M.S. (Matthijs) Berends d94efb0f5e (v2.1.1.9147) scale fixes and WISCA update, fix conserved capped values 2025-02-14 14:16:46 +01:00
dr. M.S. (Matthijs) Berends 2171f05951 (v2.1.1.9143) unit tests 2025-02-07 19:18:55 +01:00
dr. M.S. (Matthijs) Berends baea4323c7 (v2.1.1.9140) WISCA fix 2025-02-05 20:48:35 +01:00
dr. M.S. (Matthijs) Berends 700522b466 (v2.1.1.9135) documentation fix 2025-01-28 15:16:55 +01:00
dr. M.S. (Matthijs) Berends e740aa691b (v2.1.1.9134) add Gamma to WISCA documentation 2025-01-27 23:11:10 +01:00
dr. M.S. (Matthijs) Berends 2561494e06 (v2.1.1.9133) update math formulae 2025-01-27 22:43:35 +01:00
dr. M.S. (Matthijs) Berends 1149360b27 (v2.1.1.9129) unit test fix 2025-01-27 16:17:03 +01:00
dr. M.S. (Matthijs) Berends 7accf6ff13 (v2.1.1.9127) unit tests 2025-01-27 10:46:43 +01:00
dr. M.S. (Matthijs) Berends 66833b4f5a (v2.1.1.9126) implemented WISCA! Also added top_n_microorganisms() and fixed Python wrapper 2025-01-26 23:01:17 +01:00
dr. M.S. (Matthijs) Berends 92c4fc0f94 (v2.1.1.9125) replace 'antibiotic selectors' with 'antimicrobial selectors' 2025-01-17 12:09:39 +01:00
dr. M.S. (Matthijs) Berends ac1c40d8bb (v2.1.1.9081) HUGE microorganisms update for fungi! 2024-09-29 22:17:56 +02:00
dr. M.S. (Matthijs) Berends 1ca40e8d67 (v2.1.1.9079) fix for uti in as.sir() 2024-09-24 15:34:12 +02:00
dr. M.S. (Matthijs) Berends 127892430d (v2.1.1.9078) 12 new formatting formats for antibiogram(), prepare for Bayesian WISCA 2024-09-22 11:45:51 +02:00
dr. M.S. (Matthijs) Berends 640888f408 (v2.1.1.9064) update all microbial taxonomy, add mycobank, big documentation update 2024-07-16 14:53:17 +02:00
dr. M.S. (Matthijs) Berends 91fa73dedf add oxygen tolerance 2023-05-11 21:56:27 +02:00