⚠️ SERVICE NOTICE: This instance will be decommissioned 1 december of this year (2026).
Please migrate your projects to our new repository:
https://gitrepo.service.rug.nl
- 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>
- 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>
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>
- 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>
- 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>
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>
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>
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>
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>
* 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>
* 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>
* 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>
* 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>