Modeling Longitudinal Antibody Responses to Infection
Overview
Implements Bayesian hierarchical models for estimating antibody kinetic parameters from longitudinal serological data. Fits two-phase within-host models capturing antibody rise, peak, and decay following pathogen infection, using 'JAGS' for posterior inference. Designed as the upstream companion to the 'serocalculator' package for end-to-end seroepidemiological analysis. Methods are described in Teunis and colleagues (2016) doi:10.1016/j.epidem.2016.04.001 and Teunis and van Eijkeren (2020) doi:10.1002/sim.8578.
This is the first CRAN release of serodynamics, a package for Bayesian
hierarchical modeling of antibody kinetics from longitudinal serological
data. It serves as the upstream companion to the serocalculator package.
New features
- Reorganized pkgdown documentation with new "Getting Started" guide demonstrating main API workflow, organized articles into "Get started" and "Developer Notes" sections (#73).
- Made "newperson" optional in
prep_data()(#73) - Including fitted and residual values as data frame in run_mod output. (#101)
- Added
plot_predicted_curve()with support for faceting by multiple IDs (#68) - Replacing old data object with new run_mod output (#102)
- Adding class assignment to run_mod output (#76)
- Making prep_priors modifiable (#78)
- Changes to
run_mod()output:
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0
- Taking out
include_subsas an input option, default will include all
individuals
- Making a single tbl as output
- All other pieces will be attributes.
- Changes to
run_mod()(#79): jags.postnow optionally included in output, as specified by argument
with_post
- all subjects now optionally included in
curve_paramsoutput component,
as specified by argument include_subs
- Diagnostic function to produce R-hat dotplots with stratification (#67)
- Added function for summarizing estimates in a table (#74)
- Diagnostic trace plot function with strat (#64)
- Diagnostic function to produce effective sample size plots with
stratification (#66)
- Diagnostic function to produce density plots with stratification (#27)
- Added SEES data set data folder and documentation (#41)
- Fixing SEES data and added jags_post for SEES (#63)
as_case_data()now creates columnvisit_num(#47, #50)- Added
postprocess_jags_output()to API (#33) - Added
initsfunction()to API (#37) - Added participant IDs as names to
nsmplelement ofprep_data()output (#34) - Added
initsfunction()to API (#37) - Added
as_case_data()to API (#31) - Added
prep_priors()to API (#30) - Added
autoplot()method forcase_dataobjects (#28) - Added examples for
sim_pop_data(),autoplot.case_data()(#18) - Added attributes as a return to the run_mod function (#24)
- exported
run_mod()function (#22) - Function that runs jags with option of stratification included. (#14)
- Changed package name to serodynamics. (#19, #20)
Bug fixes
- Fixed
dplyr::as_tibble()references totibble::as_tibble()inpost_summ()andrun_mod(), sinceas_tibble()is exported from thetibblepackage, notdplyr.
Developer-facing changes
- Expanded what the
Claude Code(@claude) workflow can do: - Install the full R toolchain (R, JAGS, pandoc, the apt system libs mirrored from
copilot-setup-steps.yml, plusdevtools,roxygen2,rmarkdown,lintr,spelling,rcmdcheck) and allowRscript,R, andR CMDinvocations, so requests that need package- maintenance commands (devtools::document(),spelling::spell_check_package(),R CMD check, vignette rebuilds) succeed instead of being patched by hand. - Grant
issues: writeand allowgh issueinvocations so Claude can file follow-up issues for work deferred out of the current PR instead of burying it in a comment. - Standardized
runjags::findjags()casing acrosstest-coverage.yamlandcopilot-setup-steps.ymlto match theR-CMD-check.yamlform arriving with the 0.1.0 release (#207 advisory). - Re-assign reviewers to a PR's human assignees (filtered via
type == "User") when Claude pushes commits during a@claudeorClaude Code Reviewrun; if Claude makes no commits, the original reviewer set is restored as before. Detected by comparing the PR's head SHA before and after the Claude step (#210). - Stopped deleting prior Claude review comments at the start of each
Claude Code Reviewrun, so reviews posted by@claude reviewinvocations are preserved across subsequent pushes instead of being wiped when the review step fails its bot-actor gate (#217). - Hardened the Claude code-review workflow against races and silent failures: serialized concurrent runs per PR, made reviewer restore fail loudly instead of silently dropping reviewers, and cleaned up all stale Claude top-level comments per run (#216).
- Consolidated OS-specific snapshot variants: removed redundant Linux and Windows snapshot directories (which were identical), keeping only base snapshots and darwin-specific variants for macOS platform differences (#73).
- Updated Copilot instructions to encourage code decomposition and avoid copy-pasting substantial code chunks.
- Expanded
.github/copilot-instructions.mdwith additional guidance on evidence-based claims, Quarto markdown/cross-reference conventions, R style practices, and phrase-level line-break formatting for source text. - Added R 4.5+ snapshot variants to handle the changed attribute ordering in
as_case_data(), ensuring test suite compatibility with R 4.5 and later (#109). - Added dev container configuration for persistent, cached development environment that includes R, JAGS, and all dependencies preinstalled, making Copilot Workspace sessions much faster.
- Added
.github/workflows/copilot-setup-steps.ymlGitHub Actions workflow to automate environment setup for GitHub Copilot coding agent, preinstalling R, JAGS, and all dependencies. - Switched ggmcmc dependency from GitHub dev version to CRAN v1.5.1.2 (#135)
- vectorized
ab()function (#116) - Added
lintr::undesirable_function_linter()to.lintr.R(#81) - Reformatted
.lintras R file (following
https://github.com/r-lib/lintr/issues/2844#issuecomment-2776725389) (#81)
- Set shortcut pipe to be base pipe (#80)
- Added snapshot test for
run_mod() - Clarified
prep_data()internals using{dplyr}(#34) - Removed ".R" suffix from jags model files
to prevent them from getting linted as R files (#34)
- Added
dobson.Rmdminimal vignette (#36) - Overall cleaning to get checks working (#28)
- Added units tests for
prep_data(),sim_case_data()(#18) - Added various GitHub Actions (#10, #15, #18)
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-09
- ERROR12 OK, 1 ERROR2026-09-04
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
Show 2 earlier changesHide 2 earlier changes
- ERROR12 OK, 1 ERROR2026-06-08
- OK7 OK2026-06-03
Documentation
- Help pages
- 25 (7 internal)includes a package overview page
- Examples that run
- 100%16 run in a plain check
- Exported functions with examples
- 83%
- Documented parameters
- 86%
- Return-value docs
- 94%
- Help pages citing references
- 0%
- dobson HTML
Downloads
Repository
- PRs merged (all time)
- 87%
- Median days to close, 50 most recently updated closed issues
- 22
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
16 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/ucd-serg/serodynamics on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-18 · The repository has a site deploy workflow
pkgdown site last built 2026-06-15
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2025-10-02Seen in the repository: .github/copilot-instructions.md, .github/workflows/copilot-setup-steps.ymlPull request: opened by its own accountCommits: 137 by its own account · at least 2 crediting it in the message
- Claude Codefirst seen 2026-05-14Seen in the repository: .claude, .claude/skills, CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdPull request it wrote: opened by a project memberCommits: 55 by its own account · at least 80 crediting it in the message
- Codexfirst seen 2026-05-21Pull request: opened by its own accountCommits: 2 by its own account
- Claude CodePull requests: 1 from outside contributors, first on 2026-09-01
- Claude Opus 4.725 commits · May 2026
- Claude Opus 521 commits · Jul to Sep 2026
- Claude Opus 4.810 commits · May to Jun 2026
- Claude Sonnet 54 commits · Jul 2026
- Claude Sonnet 4.63 commits · Jun 2026
1 more model not listed.
Dependencies
Installing serodynamics adds 56 packages (25 with compiled code, 49 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, serocalculator 3.6 MB.
Code & Tests
Datasets
People & History
- 0.1.0Latest2026-06-02 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-06-02
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 233 KB / 2 files
- Download size
- 5.4 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("serodynamics")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.