Commit Graph
1801 Commits
Author SHA1 Message Date
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 e7e58f24f9 (v3.0.1.9101) Fix Aerococcus, Pasteurella and N. meningitidis interpretive rules (#290)
- Aerococcus rules now use `one_of`, so multi-species rules (breakpoints v12 onwards) apply
- Pasteurella rules filed under Neisseria meningitidis moved to their own rule
- Pasteurella rules now apply on genus level

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 19:46:41 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 6d54d581b2 (v3.0.1.9100) Fix unit test on wrapped warnings; taxonomy build never touches the version number
- test-data-microorganisms.R: warnings are wrapped to the console width, so the expected patterns now
  allow a line break between words (failed on GitHub Actions since v3.0.1.9097)
- reproduction_of_microorganisms_CLAUDE.md, step 4: the agent never changes the version number or date,
  the human sets them when merging

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:32:43 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 1a7f01bfb0 (v3.0.1.9099) Move microorganisms_known_defects.csv out of tests/ to data-raw/microorganisms_files/
- the list of known defects is development data and must not ship with the package
- tests read it from the source repository; mo_repository_root() now walks up from the working
  directory, so the tests also find the repository from an R CMD check directory inside it (GitHub Actions)
- the integrity, known-defects and sentinel tests skip when the source repository is not available
- CLAUDE.md: on local commits to main, the git hooks set the version number and date

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 19:34:07 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 6ab8ff8c33 (v3.0.1.9098) Approve name of species group B_MYCBC_AVIM-C as 'Mycobacterium avium complex'
As curated in data-raw/Species groups.xlsx since July 2023; the released v3.0.1 data still
used 'Mycobacterium avium-intracellulare complex' for the same group of organisms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:16:47 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 83a4853936 (v3.0.1.9097) Never remove released taxa; link orthographic variants; registry line in NEWS
- taxonomy build: released taxa (since v2.0.0) that are missing are restored from their
  last release with their old code and last known status, and are exempt from later
  removals (decision by Matthijs S. Berends)
- exceptions are retired on purpose in data-raw/microorganisms_files/mo_code_retirements.csv
  with a reason: other organisms with the same genus name (e.g. the Graphium butterflies,
  wrongly in the Fungi until v3.0.1) and taxa whose genus is now only known in another
  domain; as.mo() translates these codes to NA with that reason
- synonyms without a current name are linked to an accepted name in the same genus that
  only differs by a Latin gender ending (e.g. Candida glabratus -> Nakaseomyces glabratus)
- placeholders such as "(unknown class)" never become records; codes of manually added
  records are matched by domain and name
- integrity rule released_taxon_missing; known defects of the data on main updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:15:08 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 d683b9e7c6 (v3.0.1.9096) MO code registry: codes never change meaning, are never guessed, and are validated
- data-raw/microorganisms_files/: registry of all MO codes of every release since v2.0.0
  (78,992 codes, built from the git tags), approved renames, and README with the rules;
  decision by Matthijs S. Berends: MO codes from before v2.0.0 are not supported
- as.mo(): codes of earlier releases are translated deterministically via the internal
  MO_RETIRED_CODES (generated from the registry); unknown codes are no longer guessed
  (previously F_TRCHP, Trichophyton in v3.0.1, became Talaromyces chlamydosporus)
- synonym_mo_to_accepted_mo(): a missing target of one source no longer overwrites a valid
  target of another source (e.g. Chaetomium abuense), and no 'renamed to itself'
- taxonomy build: codes are reused and reserved from the registry instead of the development
  data (fixes 40 codes reused in the 2026 development data), also for phylum to family;
  synonym cycles are broken; dangling 'renamed to' identifiers are removed; the build stops
  on any broken integrity rule before saving
- run_microorganisms_build.R: runs the build in chunks at its checkpoints in one R process,
  with progress logging and resuming from any checkpoint; prompt updated accordingly
- tests: shared integrity rules (helper-microorganisms.R) used by build and testthat, registry
  tests over all codes, sentinel organisms, regression tests; current defects of the data on
  main are listed in microorganisms_known_defects.csv until the next rebuild

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 11:45:25 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 ca5fa333ca (v3.0.1.9095) Taxonomy build: fix root causes of missing and misclassified taxa, add unattended run prompt
Review of reproduction_of_microorganisms.R against the 2026 intermediates:
- genus homonyms: overrides, LPSN/MycoBank first, status within LPSN/MycoBank,
  move misplaced protists, remove true homonyms (Necator, Capillaria, Graphium)
- keep clinically relevant names that are not validly published (Tropheryma)
- one set of relevant genera for all filters; 30 genera added to MO_RELEVANT_GENERA
- MycoBank classification parsed from all columns; empty values never overwrite
- GBIF synonyms in another genus get the lineage of their own genus
- prevalence no longer copied from genus; current names inherit from synonyms
- inferred records follow the relevance filters (no more unrelated lichens)
- ASCII names before deduplication (12 duplicate full names in 2026)
- MO codes: robust code parsing, reserved old codes, single allocator,
  domain column used directly (2026 rename would now fail)
- name clean-up applied to taxonomy before MO codes, BacDive rows filled
- unattended running: review() instead of View(), CSV export of reviews,
  LPSN cache and retries, stops when raw source files are missing
- reproduction_of_microorganisms_CLAUDE.md: prompt for an unattended run with
  findings report and checklist for human review in the PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 09:06:27 +02:00
dr. M.S. (Matthijs) BerendsandClaude Opus 5.5 b264f175f4 (v3.0.1.9094) Taxonomy build: resolve cross-domain genus homonyms by status and source (#309)
Genus resolution now prefers LPSN/MycoBank over GBIF, then accepted over
synonym, then source, then rank, and only then domain. Losing LPSN/MycoBank
homonyms are removed instead of moved into another domain. Adds integrity
checks that LPSN records stay prokaryotic and MycoBank records stay fungal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 08:08:46 +02:00
Matthijs BerendsandClaude Opus 5.5 dab4c47e86 EUCAST import: blocking rows, note restrictions, PK-PD and parser fixes (#310)
Make the EUCAST Clinical Breakpoint Tables import (2019-2026) fail-safe:

- Add blocking rows (NA breakpoints, reason in `note`) where EUCAST gives
  no breakpoint for an organism (IE, "-", Note, brackets, "except"
  clauses, table scope), so as.sir() no longer falls back to broader taxa
- Apply restrictions from EUCAST notes via a curated rule table with a
  completeness guard (e.g. zone diameters for E. coli only)
- Import PK-PD (non-species related) breakpoints 2019-2023, H.
  parainfluenzae MIC breakpoints, and explicit screening thresholds from
  notes (high-level aminoglycosides, cefoxitin MIC, unidentified CoNS)
- Parser fixes: lost Staphylococcus sheets 2019/2020, note keys and
  bodies, struck-through cells, hidden sheets, missing disk contents,
  organism groups, site vocabulary, MIC dilution levels, off-scale
  breakpoints stored as 0.0001
- Keep EUCAST antifungal breakpoints 2019-2025 from WHONET; code WHONET
  streptomycin as STR1 instead of STR (streptoduocin)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 06:01:58 +02:00
Matthijs Berends 5d9974e2b9 implement EUCAST >= 2019 directly from their source files 2026-10-01 14:53:00 +01:00
dr. M.S. (Matthijs) Berends aebad2ae47 (v3.0.1.9091) unit test 2026-09-08 15:02:07 +02:00
dr. M.S. (Matthijs) Berends 3f50d6b6c3 (v3.0.1.9090) unit test 2026-09-04 19:47:30 +02:00
dr. M.S. (Matthijs) Berends 177e83aaf8 (v3.0.1.9089) Remove old expert rules that conflict with expected resistant phenotypes 2026-09-03 15:53:29 +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
Matthijs Berends 2c33297cf6 new eucast breakpoints parsing 2026-08-20 13:29:16 +01:00
dr. M.S. (Matthijs) Berends bd9244206d (v3.0.1.9086) new eucast update flow 2026-08-13 11:12:12 +02:00
dr. M.S. (Matthijs) Berends c4069da61f (v3.0.1.9085) website 2026-07-09 21:05:33 +02:00
dr. M.S. (Matthijs) Berends 9237bfbc19 (v3.0.1.9084) Fix breakpoint infer rules 2026-07-09 17:14:59 +02:00
dr. M.S. (Matthijs) Berends ea996c8361 (v3.0.1.9083) website 2026-07-03 19:41:16 +02:00
dr. M.S. (Matthijs) Berends 65445bcfbe (v3.0.1.9082) website 2026-07-03 19:11:40 +02:00
dr. M.S. (Matthijs) Berends e23d7b4c45 (v3.0.1.9081) fix mo 2026-06-27 15:33:08 +02:00
Matthijs BerendsandClaude 518425311e (v3.0.1.9080) fix(as.mo): resolve abbreviated genus when species has subspecies (#288 follow-up) (#301)
When a genus+species abbreviation like "P. ovale" was used, the previous
bypass (Issue #288) checked sum(sp_exact) == 1, which failed if the species
also had subspecies sharing the epithet (ovale curtisi, ovale wallikeri).
The fix extends the bypass to fire whenever all exact species matches belong
to one genus, collapsing to the species-rank record (subspecies == "") for
genus+species queries and preserving the chosen row for explicit subspecies
queries.

Also extends the data-invariant test to cover all taxonomic rank columns
from domain to subspecies, not just the terminal three.


Claude-Session: https://claude.ai/code/session_01M4fqQYQYJ3drdudkDYNqAY

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-27 15:20:38 +02:00
Matthijs BerendsandClaude Sonnet 4.6 03be4b87fc (v3.0.1.9079) docs: rename remaining 'antibiotic selectors'/'AB selectors' to 'antimicrobial selectors'/'AMR selectors'
* docs: rename remaining 'antibiotic selectors'/'AB selectors' to 'antimicrobial selectors'/'AMR selectors'

Five leftover occurrences of the old terminology updated in the AMR
vignette (section heading + code comment), the amr_selectors test file,
and two roxygen example comments in amr_selectors.R. The auto-generated
man/antimicrobial_selectors.Rd will update on the next devtools::document() run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169LucQ7SHDLHdTnDs1ENhd

* fix

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-27 14:31:58 +02:00
Matthijs Berends 12cabca29d (v3.0.1.9076) fix: normalise year-qualified AMR_guideline option in all affected functions 2026-06-27 13:53:25 +02:00
Matthijs Berends f7d353361c improve top_n_microorganisms(): add property_for_each, fix property=NULL, enforce rank order (#297) 2026-06-26 21:40:11 +02:00
Matthijs Berends 02bd9a71c1 (v3.0.1.9076) document Python installation channels and enforce_method in vignette (#296) 2026-06-26 15:03:07 +02:00
dr. M.S. (Matthijs) Berends 5f6372342e (v3.0.1.9075) another go 2026-06-26 12:06:12 +02:00
dr. M.S. (Matthijs) Berends 3c17679382 (v3.0.1.9074) You go girl 2026-06-26 11:58:38 +02:00
dr. M.S. (Matthijs) Berends 4ca7fdf3d4 (v3.0.1.9073) yet another go 2026-06-26 11:51:08 +02:00
dr. M.S. (Matthijs) Berends 6edae2037a (v3.0.1.9072) fix py again 2026-06-26 11:47:11 +02:00
dr. M.S. (Matthijs) Berends 61e1fbf1e0 (v3.0.1.9071) fix python wrapper 2026-06-26 11:35:30 +02:00
dr. M.S. (Matthijs) Berends 637ada920b (v3.0.1.9070) Fix #293, update EUCAST rules for PEF 2026-06-26 08:56:59 +02:00
dr. M.S. (Matthijs) Berends 4fac683fac (v3.0.1.9069) fix Python wrapper 2026-06-24 20:27:39 +02:00
dr. M.S. (Matthijs) Berends b6c1c26a5d (v3.0.1.9068) todo tracker update 2026-06-24 20:01:25 +02:00
dr. M.S. (Matthijs) Berends 935071ae01 (v3.0.1.9067) todo tracker update 2026-06-24 19:43:02 +02:00
dr. M.S. (Matthijs) Berends a88150ca4a (v3.0.1.9066) fix documentation 2026-06-24 19:34:47 +02:00
dr. M.S. (Matthijs) Berends 39b6a250de (v3.0.1.9065) fix example isolates data 2026-06-24 18:36:47 +02:00
dr. M.S. (Matthijs) Berends bd63794136 (v3.0.1.9064) Documentation updates 2026-06-24 18:32:08 +02:00
dr. M.S. (Matthijs) Berends c7b17e5833 (v3.0.1.9063) fix old R version 2026-06-24 10:22:56 +02:00
dr. M.S. (Matthijs) Berends ab38fb911d (v3.0.1.9062) Fix older R versions 2026-06-24 10:19:15 +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 64753e9a16 Revamp beta NEWS.md section: concise, user-focused, telegram style (#284)
* Revamp beta NEWS.md section: concise, user-focused, telegram style

https://claude.ai/code/session_01CnwgKsQqnKNdSD2KjwFAdH

* Loosen NEWS.md telegram style: add context words for clarity

https://claude.ai/code/session_01CnwgKsQqnKNdSD2KjwFAdH

* Add issue/PR references to beta NEWS.md entries

https://claude.ai/code/session_01CnwgKsQqnKNdSD2KjwFAdH

* Add antimicrobial codes to new antimicrobials list in NEWS.md

https://claude.ai/code/session_01CnwgKsQqnKNdSD2KjwFAdH

* Replace em dashes with natural English punctuation in NEWS.md

https://claude.ai/code/session_01CnwgKsQqnKNdSD2KjwFAdH

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-02 10:31:33 +01:00
Matthijs BerendsandClaude 24f24ecaf8 Generalise interpretive rules for multi-guideline support (#268) (#283)
* Generalise interpretive rules for multi-guideline support (#268)

- Rename data-raw/eucast_rules.tsv → interpretive_rules.tsv; add rule.provider
  column (value: "EUCAST") to distinguish future CLSI rows
- Rename EUCAST_RULES_DF → INTERPRETIVE_RULES_DF in _pre_commit_checks.R;
  filter by rule.provider == guideline when applying rules in interpretive_rules()
- Rename custom_eucast_rules() → custom_interpretive_rules() with new S3 class
  "custom_interpretive_rules"; old function becomes a deprecated wrapper in
  zz_deprecated.R; backward-compat S3 dispatch shims added for old class
- Remove stop_if(guideline == "CLSI", ...) so clsi_rules() no longer errors
- Add .onLoad shim in zzz.R to create INTERPRETIVE_RULES_DF from EUCAST_RULES_DF
  for transitional compatibility until sysdata.rda is regenerated

https://claude.ai/code/session_01D46BTsfJSPo3HnLWp3PRkP

* Fix namespace load failure: remove assignInNamespace from .onLoad (#268)

assignInNamespace cannot add NEW bindings to a locked package namespace
(R locks namespace bindings before .onLoad runs). Replace the .onLoad
shim with a runtime fallback inside interpretive_rules(): if
INTERPRETIVE_RULES_DF is absent (pre-regeneration sysdata.rda), derive
it from EUCAST_RULES_DF by adding the rule.provider column. This also
fixes the screening_abx line to reuse the already-resolved
interpretive_rules_df_total instead of a bare INTERPRETIVE_RULES_DF
reference.

https://claude.ai/code/session_01D46BTsfJSPo3HnLWp3PRkP

* fixes

* fixes

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-01 18:38:51 +01: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 BerendsandClaude 23beebc6c3 Migrate parallel computing in as.sir() from parallel:: to future/future.apply (#280)
* Migrate parallel computing in as.sir() from parallel:: to future/future.apply

Replace parallel::mclapply() and parallel::parLapply() with
future.apply::future_lapply(), enabling transparent support for any
future backend (multisession, multicore, mirai_multisession, cluster)
on all platforms including Windows.

When parallel = TRUE the function now: (1) respects an active
future::plan() set by the user without overriding it on exit, or
(2) sets a temporary multisession plan with parallelly::availableCores()
and tears it down on exit. The max_cores argument controls worker count
only when no user plan is active.

future and future.apply are added to Suggests in DESCRIPTION.

https://claude.ai/code/session_01M1Jvf2Miu6JL4TQrEh1wS8

* Require user plan() for parallel=TRUE; fix as_wt_nwt false-positive warnings

- parallel = TRUE now errors with a cli-styled message if no non-sequential
  future::plan() is active; users must call e.g. future::plan(future::multisession)
  before using parallel = TRUE (breaking change)
- Removed auto-setup/teardown of multisession plan inside as.sir(), which was
  slow and caused version-mismatch issues with load_all() workflows
- Added as_wt_nwt to the exclusion list in as_sir_method() to suppress
  false-positive "no longer used" warnings during parallel runs
- Fixed pieces_per_col row-batch calculation to use n_workers (total available
  workers from the active plan) instead of n_cores (workers clipped to n_cols),
  so row-batch mode activates correctly when n_cols < n_workers
- Updated @param parallel and @param max_cores roxygen docs; regenerated man/as.sir.Rd
- Updated sequential-mode hint to instruct users to set plan() first

https://claude.ai/code/session_01M1Jvf2Miu6JL4TQrEh1wS8

* fix parallel

* fix parallel

* unit tests

* unit tedts

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-30 08:57:19 +01:00
dr. M.S. (Matthijs) Berends 3f1b20c304 (v3.0.1.9052) fix NEWS 2026-04-25 16:21:31 +02:00