Skip to content

Commit 63cfd5c

Browse files
author
Tim Tsang
committed
Fix CRAN readiness: correct DOI, cap RcppParallel threads, add LICENSE/NEWS
- Fix DOI typo: s41467-022-29233-8 → s41467-022-29310-8 (7 locations) - Add .onLoad() thread cap (2 threads) per CRAN policy - Add LICENSE.md and NEWS.md; exclude LICENSE.md from tarball - Add cran-comments.md; update .Rbuildignore - R CMD check --as-cran: 0E/0W/2N (new submission + time check only)
1 parent 403b230 commit 63cfd5c

9 files changed

Lines changed: 117 additions & 6 deletions

File tree

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
^_pkgdown\.yml$
99
^docs$
1010
^pkgdown$
11+
^cran-comments\.md$
12+
^LICENSE\.md$

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Description: A Bayesian framework for inferring influenza infection status from
1414
probabilities, antibody boosting and waning after infection, and baseline HAI
1515
titer distributions via MCMC. Supports multi-season analysis and subgroup
1616
comparisons via a group_by interface. See Tsang et al. (2022)
17-
<doi:10.1038/s41467-022-29233-8> for methodological details.
17+
<doi:10.1038/s41467-022-29310-8> for methodological details.
1818
License: GPL (>= 2)
1919
Encoding: UTF-8
2020
LazyData: TRUE

LICENSE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GNU GENERAL PUBLIC LICENSE
2+
3+
Version 2, June 1991
4+
5+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
6+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7+
8+
Everyone is permitted to copy and distribute verbatim copies of this license
9+
document, but changing it is not allowed.
10+
11+
## Preamble
12+
13+
The licenses for most software are designed to take away your freedom to share
14+
and change it. By contrast, the GNU General Public License is intended to
15+
guarantee your freedom to share and change free software — to make sure the
16+
software is free for all its users. This General Public License applies to most
17+
of the Free Software Foundation's software and to any other program whose
18+
authors commit to using it. (Some other Free Software Foundation software is
19+
covered by the GNU Lesser General Public License instead.) You can apply it to
20+
your programs, too.
21+
22+
Full license text: <https://www.gnu.org/licenses/gpl-2.0.html>
23+
24+
---
25+
26+
**seroreconstruct** is copyright (C) 2022 Tim Tsang and is distributed under
27+
the terms of the GNU General Public License, version 2 or later (GPL-2+).

NEWS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# seroreconstruct 1.1.0
2+
3+
## New features
4+
5+
* `sero_reconstruct()` gains a `group_by` argument for subgroup analysis — fit
6+
independent MCMCs for age groups, vaccination status, or other strata defined
7+
by a one-sided formula (e.g., `~age_group`).
8+
9+
* `sero_reconstruct()` gains a `shared` argument for joint models — run a single
10+
MCMC that shares measurement error (`"error"`) and/or antibody
11+
boosting/waning (`"boosting_waning"`) across groups while estimating
12+
group-specific infection risk. Measurement error is always shared when
13+
comparing groups of the same virus subtype.
14+
15+
* `sero_reconstruct()` gains a `subject_ids` argument for ID-based individual
16+
lookup in `plot_trajectory()`.
17+
18+
* **Multi-season support** — add a 0-indexed integer `season` column to input
19+
data; the model estimates season-specific infection risk and HAI protection
20+
parameters.
21+
22+
* **S3 classes** `seroreconstruct_fit`, `seroreconstruct_joint`, and
23+
`seroreconstruct_multi` with `print()` and `summary()` methods.
24+
25+
* **New plot functions:** `plot_trajectory()`, `plot_boosting()`,
26+
`plot_waning()`, `plot_infection_prob()`, `plot_diagnostics()`.
27+
28+
* **New table functions:** `table_parameters()`, `table_infections()`.
29+
30+
* **`simulate_data()`** — generate synthetic HAI titer datasets for validation
31+
and power analysis.
32+
33+
## Deprecated
34+
35+
* `output_model_estimate()` is deprecated. Use `table_parameters()` and
36+
`table_infections()` instead.
37+
38+
---
39+
40+
# seroreconstruct 1.0.0
41+
42+
* Initial release. Core Bayesian MCMC framework for inferring influenza
43+
infection status, antibody dynamics, and individual infection risks from
44+
longitudinal HAI titer data.
45+
46+
* Based on Tsang TK et al. (2022) *Nat Commun* 13:1557.
47+
<https://doi.org/10.1038/s41467-022-29310-8>

R/seroreconstruct-package.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
#' @importFrom graphics layout par plot abline axis box lines points legend polygon segments
99
#' @importFrom stats quantile density median acf
1010
NULL
11+
12+
.onLoad <- function(libname, pkgname) {
13+
# CRAN policy: packages must not use more than 2 threads during checks.
14+
# Users can override via RCPP_PARALLEL_NUM_THREADS environment variable.
15+
RcppParallel::setThreadOptions(numThreads = 2L)
16+
}

cran-comments.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CRAN submission comments — seroreconstruct 1.1.0
2+
3+
## R CMD check results
4+
5+
0 errors | 0 warnings | 1 note
6+
7+
### Note 1: New submission
8+
```
9+
N checking CRAN incoming feasibility
10+
Maintainer: 'Tim Tsang <timkltsang@gmail.com>'
11+
New submission
12+
```
13+
This is a new submission; the package is not currently on CRAN.
14+
15+
## Thread policy
16+
17+
RcppParallel threads are capped to 2 in `.onLoad()` per CRAN policy.
18+
Users can override via the `RCPP_PARALLEL_NUM_THREADS` environment variable.
19+
20+
## Reverse dependencies
21+
22+
None — this is a new submission.
23+
24+
## Tested on
25+
26+
- macOS (local): R 4.4.x
27+
- Ubuntu 22.04 (GitHub Actions, `release`)
28+
- Ubuntu 22.04 (GitHub Actions, `devel`)
29+
- Windows Server 2022 (GitHub Actions)

man/seroreconstruct-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/introduction.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ over time, and measurement error — estimating individual-level infection
2525
probabilities from hemagglutination inhibition (HAI) titer data.
2626

2727
The statistical framework is described in
28-
[Tsang et al. (2022) *Nature Communications* 13:1557](https://doi.org/10.1038/s41467-022-29233-8).
28+
[Tsang et al. (2022) *Nature Communications* 13:1557](https://doi.org/10.1038/s41467-022-29310-8).
2929

3030
## Input data
3131

@@ -185,4 +185,4 @@ To cite seroreconstruct in publications:
185185
> Malik Peiris JS, Leung GM, Cowling BJ, Cauchemez S. (2022).
186186
> Reconstructing antibody dynamics to estimate the risk of influenza virus
187187
> infection. *Nature Communications* 13:1557.
188-
> doi: [10.1038/s41467-022-29233-8](https://doi.org/10.1038/s41467-022-29233-8)
188+
> doi: [10.1038/s41467-022-29310-8](https://doi.org/10.1038/s41467-022-29310-8)

vignettes/methodology.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The model accounts for:
2626
- Heterogeneity in baseline titers and infection risk
2727

2828
The full statistical details are described in
29-
[Tsang et al. (2022) *Nature Communications* 13:1557](https://doi.org/10.1038/s41467-022-29233-8).
29+
[Tsang et al. (2022) *Nature Communications* 13:1557](https://doi.org/10.1038/s41467-022-29310-8).
3030

3131
## Notation
3232

@@ -155,7 +155,7 @@ Tsang TK, Perera RAPM, Fang VJ, Wong JY, Shiu EY, So HC, Ip DKM,
155155
Malik Peiris JS, Leung GM, Cowling BJ, Cauchemez S. (2022).
156156
Reconstructing antibody dynamics to estimate the risk of influenza virus
157157
infection. *Nature Communications* 13:1557.
158-
doi: [10.1038/s41467-022-29233-8](https://doi.org/10.1038/s41467-022-29233-8)
158+
doi: [10.1038/s41467-022-29310-8](https://doi.org/10.1038/s41467-022-29310-8)
159159

160160
Geyer CJ. (1992). Practical Markov chain Monte Carlo. *Statistical Science*
161161
7(4):473–483.

0 commit comments

Comments
 (0)