-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hyperlink-function-names
- Loading branch information
Showing
70 changed files
with
1,676 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ allpopsamples_hlye.csv$ | |
^serocalculator.*\.tgz$ | ||
^inst/extdata | ||
^CRAN-SUBMISSION$ | ||
^README\.qmd$ | ||
^codecov\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
|
||
name: "Documentation check" | ||
|
||
jobs: | ||
docs-check: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ github.token }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- name: Install dependencies | ||
uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::roxygen2 | ||
needs: roxygen2 | ||
|
||
- name: Document | ||
run: roxygen2::roxygenise() | ||
shell: Rscript {0} | ||
|
||
- name: Check for changed files | ||
run: | | ||
git add --all | ||
changes=$(git diff-index HEAD --name-only -- man/ NAMESPACE DESCRIPTION) | ||
if [ -n "$changes" ]; then | ||
echo "Changes found after documenting." | ||
git --no-pager diff | ||
echo "$changes" | ||
echo "Please update documentation." | ||
exit 1 | ||
else | ||
echo "No changes found after documenting." | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
|
||
name: test-coverage | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::covr, any::xml2 | ||
needs: coverage | ||
|
||
- name: Test coverage | ||
run: | | ||
cov <- covr::package_coverage( | ||
quiet = FALSE, | ||
clean = FALSE, | ||
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | ||
) | ||
covr::to_cobertura(cov) | ||
shell: Rscript {0} | ||
|
||
- uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} | ||
file: ./cobertura.xml | ||
plugin: noop | ||
disable_search: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Show testthat output | ||
if: always() | ||
run: | | ||
## -------------------------------------------------------------------- | ||
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
shell: bash | ||
|
||
- name: Upload test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-test-failures | ||
path: ${{ runner.temp }}/package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: serocalculator | ||
Type: Package | ||
Title: Estimating Infection Rates from Serological Data | ||
Version: 1.1.0 | ||
Version: 1.2.0.9000 | ||
Authors@R: c( | ||
person(given = "Peter", family = "Teunis", email = "[email protected]", role = c("aut", "cph"), comment = "Author of the method and original code."), | ||
person(given = "Kristina", family = "Lai", email = "[email protected]", role = c("aut", "cre")), | ||
|
@@ -42,11 +42,12 @@ Suggests: | |
readr, | ||
bookdown, | ||
ggbeeswarm, | ||
DT | ||
DT, | ||
spelling | ||
LazyData: true | ||
Encoding: UTF-8 | ||
URL: https://github.com/UCD-SERG/serocalculator, https://ucd-serg.github.io/serocalculator/ | ||
RoxygenNote: 7.3.1 | ||
RoxygenNote: 7.3.2 | ||
NeedsCompilation: no | ||
LinkingTo: | ||
Rcpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#' Load antibody decay curve parameter | ||
#' | ||
#' @param data a [data.frame()] or [tibble::tbl_df] | ||
#' @param antigen_isos [character()] vector of antigen isotypes to be used in analyses | ||
#' @returns a `curve_data` object (a [tibble::tbl_df] with extra attribute `antigen_isos`) | ||
#' @export | ||
#' @examples | ||
#' library(magrittr) | ||
#' curve_data <- | ||
#' "https://osf.io/download/rtw5k/" %>% | ||
#' readr::read_rds() %>% | ||
#' as_curve_params() | ||
#' | ||
#' print(curve_data) | ||
|
||
as_curve_params <- function(data, antigen_isos = NULL) { | ||
curve_data <- | ||
data %>% | ||
tibble::as_tibble() | ||
|
||
# define curve columns | ||
curve_cols <- c("antigen_iso", "y0", "y1", "t1", "alpha", "r") | ||
|
||
# check if object is curve (with columns) | ||
if (!all(is.element(curve_cols, curve_data %>% names()))) { | ||
cli::cli_abort("Please provide curve data") | ||
} | ||
|
||
# assign curve class | ||
class(curve_data) <- | ||
c("curve_params", class(curve_data)) | ||
|
||
|
||
if (is.null(antigen_isos)) { | ||
antigen_isos <- unique(curve_data$antigen_iso) | ||
} else { | ||
stopifnot(all( | ||
is.element(antigen_isos, curve_data$antigen_iso) | ||
)) | ||
} | ||
|
||
# assign antigen attribute | ||
attr(curve_data, "antigen_isos") <- antigen_isos | ||
|
||
return(curve_data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.