diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9309e32c..984a1335 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -22,7 +22,6 @@ jobs: - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - {os: ubuntu-latest, r: '4.0.4', pandoc-version: '2.11.4'} env: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 00000000..7222284e --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,72 @@ +# 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, develop] + pull_request: + branches: [main, master, develop] + +name: test-coverage.yaml + +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-pandoc@v2 + + - uses: r-lib/actions/setup-tinytex@v2 + + - name: Preinstall required latex packages + run: > + tlmgr install + lastpage morefloats parskip pdflscape textpos multirow lipsum + fancyhdr colortbl soul setspace relsize makecell threeparttable + threeparttablex environ trimspaces + + - 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 diff --git a/DESCRIPTION b/DESCRIPTION index ea0fd1e3..26e755f8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: VISCtemplates Title: Tools for writing reproducible reports at VISC -Version: 1.3.2 +Version: 1.3.2.9000 Authors@R: person(given = "Jimmy", family = "Fulp", diff --git a/NEWS.md b/NEWS.md index f0a254e4..f5e09093 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,19 @@ +# VISCtemplates (development version) + +Bug fixes +* Provide default CRAN mirror if missing in install_load_cran_packages(), e.g., in a child R session during knitting. Fixes 'trying to use CRAN without setting a mirror' error (#218) +* Update template.tex so that flextable package can be used to create tables in PDF documents (#226) +* Clean up invalid ORCID placeholder generated by usethis 3.0.0 that threw error on R version 4.5.x (#248) +* Fix error when running skeleton.Rmd file interactively (#249) +* Include pdata object name and data package name in visc_load_pdata() error message (#252) + +Other improvements +* create_visc_project() now discards README.Rmd after knitting template to README.md (#223) +* Update PT report naming practices to the format VDCnnn_assay_PTreport_interim/final_(un)blinded.Rmd (#202) +* Add auxiliary files to template .gitignore (.aux, .toc, .lof, .lot, .out, cache files, and .smbdelete files) (#230) +* Update names in template acknowledgements section (#234) +* Include dataspec html in the files to ignore in use_visc_gitignore() (#254) + # VISCtemplates 1.3.2 Bug Fix @@ -50,7 +66,6 @@ Package Maintenance * Adjust dependencies in DESCRIPTION (#164) * Update package authors and maintainer (#190) * Clean up latex template code, removing commented-out code and reorganizing for better readability (#196) -* Include dataspec html in the files to ignore in use_visc_gitignore() (#254) # VISCtemplates 1.2.0 diff --git a/R/create_visc_project.R b/R/create_visc_project.R index 44a48671..15699ae2 100644 --- a/R/create_visc_project.R +++ b/R/create_visc_project.R @@ -33,7 +33,15 @@ create_visc_project <- function(path, interactive = TRUE){ usethis::create_package( path = path, rstudio = TRUE, - open = interactive + open = interactive, + # fields override for usethis 3.0.0 ORCID placeholder that errored in R 4.5 + # https://github.com/r-lib/usethis/issues/2059 + fields = list( + `Authors@R` = paste0( + "person(\"First\", \"Last\", email = \"first.last", + "@example.com\", role = c(\"aut\", \"cre\"))" + ) + ) ) # must set active project otherwise it is diff --git a/R/report_functions.R b/R/report_functions.R index 82abc557..3f16de03 100644 --- a/R/report_functions.R +++ b/R/report_functions.R @@ -15,7 +15,10 @@ install_load_cran_packages <- function(packages) { stop(paste0("The package ", package, " must be installed through GitHub: https://github.com/FredHutch/", package, ".git")) } else { - utils::install.packages(package) + # provide a default CRAN mirror if missing (e.g. in knitr R session) + repos <- getOption("repos") + if ("@CRAN@" %in% repos) repos <- "https://cloud.r-project.org/" + utils::install.packages(package, repos = repos) # install.packages() installs packages from the repository identified in # options('repos'), which is CRAN by default. To change this # setting, edit your .Rprofile. To view a list of available CRAN diff --git a/R/use_visc_gitignore.R b/R/use_visc_gitignore.R index 899fa2b2..09469efd 100644 --- a/R/use_visc_gitignore.R +++ b/R/use_visc_gitignore.R @@ -36,10 +36,19 @@ use_visc_gitignore <- function(directory = ".") { "Thumbs.db", # files from Latex "*.log", + "*.aux", + "*.toc", + "*.lof", + "*.lot", + "*.out", "**/figure-latex/*.pdf", "**/figure-docx/*.pdf", "*.zip", "*dataspec*.html" + # cache files + "*_cache/", + # other + ".smbdelete*" ), directory = directory ) diff --git a/R/use_visc_report.R b/R/use_visc_report.R index b59879d2..34897742 100644 --- a/R/use_visc_report.R +++ b/R/use_visc_report.R @@ -16,6 +16,21 @@ use_visc_readme <- function(study_name, save_as = "README.Rmd") { data = list(study_name = study_name), package = "VISCtemplates" ) + # knit the md from the Rmd on request of SRA team + rmarkdown::render( + usethis::proj_path('README.Rmd'), + quiet = TRUE + ) + # remove Rmd at request of SRA team; they just manually edit the *.md + # so the Rmd file merely clutters their working directory + unlink( + usethis::proj_path( + paste0( + 'README', + c('.Rmd', '.html') + ) + ) + ) } #' Create a VISC docs directory with template files @@ -105,7 +120,7 @@ use_bib <- function(study_name) { #' #' @param report_name name of the file (character) #' @param path path of the file within the active project -#' @param report_type "empty", "generic", "bama", or "nab" +#' @param report_type "empty", "generic", "bama", "nab", or "adcc" #' @param interactive TRUE by default. FALSE is for non-interactive unit testing #' only. #' @@ -119,20 +134,20 @@ use_bib <- function(study_name) { #' report_type = "bama" #' ) #' } -use_visc_report <- function(report_name = "PT-Report", +use_visc_report <- function(report_name = "PTreport", path = ".", - report_type = c("empty", "generic", "bama", "nab"), + report_type = c("empty", "generic", "bama", "nab", "adcc"), interactive = TRUE) { - stopifnot(report_type %in% c("empty", "generic", "bama", "nab")) + stopifnot(report_type %in% c("empty", "generic", "bama", "nab", "adcc")) # suppress usethis output when non-interactive old_usethis_quiet <- getOption('usethis.quiet') on.exit(options(usethis.quiet = old_usethis_quiet)) - options(usethis.quiet = ! interactive) + options(usethis.quiet = !interactive) if (report_type != 'empty') challenge_visc_report(report_name, interactive) - if (! dir.exists(path)) dir.create(path, recursive = TRUE) + if (!dir.exists(path)) dir.create(path, recursive = TRUE) use_template <- paste0( 'visc', '_', if (report_type == 'empty') 'empty' else 'report' ) @@ -145,7 +160,7 @@ use_visc_report <- function(report_name = "PT-Report", usethis::ui_done( glue::glue("Creating {{report_type}} VISC report at '{{file.path(path, report_name)}}'") ) - if (report_type != 'empty'){ + if (report_type != 'empty') { use_visc_methods(path = file.path(path, report_name), assay = report_type, interactive = interactive) } @@ -154,15 +169,15 @@ use_visc_report <- function(report_name = "PT-Report", } challenge_visc_report <- function(report_name, interactive = TRUE) { - if (! interactive) return(invisible(NULL)) + if (!interactive) return(invisible(NULL)) continue <- usethis::ui_yeah(" Creating a new VISC PT Report called {report_name}. At VISC, we use a naming convention for PT reports: - 'VDCnnn_assay_PT_Report_statusifapplicable' - where 'statusifapplicable' distinguishes blinded reports, - HIV status, or something that distinguishes a type/subset - of a report. + 'VDCnnn_assay_PTreport_status_blindingifapplicable' + where 'status' should be either 'interim' or 'final' + and 'blindingifapplicable' should be either 'blinded' + or 'unblinded' (applicable to interim reports only). 'VDC' is the PI name and 'nnn' is the study number. Would you like to continue?") @@ -177,7 +192,7 @@ challenge_visc_report <- function(report_name, interactive = TRUE) { #' used in PT reports: statistical-methods.Rmd, lab-methods.Rmd, #' and biological-endpoints.Rmd #' -#' @param assay "bama" or "generic" +#' @param assay "generic", "bama", "nab" or "adcc" #' @param path path within the active project #' @param interactive TRUE by default. FALSE is for non-interactive unit testing #' only. @@ -188,13 +203,13 @@ challenge_visc_report <- function(report_name, interactive = TRUE) { #' \dontrun{ #' use_visc_methods(path = "bama/BAMA-PT-Report", assay = "bama") #' } -use_visc_methods <- function(path = ".", assay = c("generic", "bama", "nab"), +use_visc_methods <- function(path = ".", assay = c("generic", "bama", "nab", "adcc"), interactive = TRUE) { # suppress usethis output when non-interactive old_usethis_quiet <- getOption('usethis.quiet') on.exit(options(usethis.quiet = old_usethis_quiet)) - options(usethis.quiet = ! interactive) + options(usethis.quiet = !interactive) pkg_ver <- utils::packageVersion("VISCtemplates") diff --git a/R/visc_load_pdata.R b/R/visc_load_pdata.R index 918495b9..3c07a0d2 100644 --- a/R/visc_load_pdata.R +++ b/R/visc_load_pdata.R @@ -75,7 +75,13 @@ visc_load_pdata <- function(.data, lazyLoad(filebase = system.file(file.path('data', 'Rdata'), package = pkg_name), envir = pdata_env) } else { - stop('Unable to find data object file') + stop( + sprintf( + "Unable to find data object '%s' in package '%s'", + pdata_name, + pkg_name + ) + ) } } diff --git a/README.Rmd b/README.Rmd index 1b084511..81944b4a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,6 +13,11 @@ knitr::opts_chunk$set( ) ``` + +[![R-CMD-check](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/FredHutch/VISCtemplates/graph/badge.svg)](https://app.codecov.io/gh/FredHutch/VISCtemplates) + + # VISCtemplates The goal of VISCtemplates is to: @@ -76,7 +81,7 @@ Use a VISC Report: ```{r eval=FALSE} use_visc_report( - report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file + report_name = "VDCnnn_BAMA_PTreport_interim_blinded", # the name of the report file path = "BAMA", # the path within the active directory, usually the name of the assay report_type = "bama" # "empty", "generic", "bama", or "nab" ) diff --git a/README.md b/README.md index 650d8858..9664956d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ + + +[![R-CMD-check](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FredHutch/VISCtemplates/actions/workflows/R-CMD-check.yaml) +[![Codecov test +coverage](https://codecov.io/gh/FredHutch/VISCtemplates/graph/badge.svg)](https://app.codecov.io/gh/FredHutch/VISCtemplates) + # VISCtemplates @@ -66,7 +72,7 @@ Use a VISC Report: ``` r use_visc_report( - report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file + report_name = "VDCnnn_BAMA_PTreport_interim_blinded", # the name of the report file path = "BAMA", # the path within the active directory, usually the name of the assay report_type = "bama" # "empty", "generic", "bama", or "nab" ) diff --git a/inst/rmarkdown/templates/visc_empty/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/visc_empty/skeleton/skeleton.Rmd index b1cd3703..aed0db24 100644 --- a/inst/rmarkdown/templates/visc_empty/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/visc_empty/skeleton/skeleton.Rmd @@ -61,7 +61,7 @@ opts_chunk$set(cache = FALSE, out.extra = "", fig.pos = "H") # fig.align argument is not supported in Word (align in template docx) -if (knitr::opts_knit$get('rmarkdown.pandoc.to') == 'latex'){ +if (get_output_type() == 'latex'){ opts_chunk$set(fig.align = "center") } diff --git a/inst/rmarkdown/templates/visc_report/resources/template.tex b/inst/rmarkdown/templates/visc_report/resources/template.tex index 67980e15..f041eb9e 100644 --- a/inst/rmarkdown/templates/visc_report/resources/template.tex +++ b/inst/rmarkdown/templates/visc_report/resources/template.tex @@ -20,6 +20,11 @@ \usepackage{threeparttable} % provides a scheme for tables that have a structured (foot)note section, after the caption \usepackage{threeparttablex} % provides the functionality of the threeparttable package to tables created using the longtable package +% needed for flextable to work +\usepackage{hhline} +\newlength\Oldarrayrulewidth +\newlength\Oldtabcolsep + % being able to set emphasis for entire table row \newcommand\setrow[1]{\gdef\rowmac{#1}#1\ignorespaces} \newcommand\clearrow{\global\let\rowmac\relax} diff --git a/inst/rmarkdown/templates/visc_report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/visc_report/skeleton/skeleton.Rmd index f069abac..4d6a10f0 100644 --- a/inst/rmarkdown/templates/visc_report/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/visc_report/skeleton/skeleton.Rmd @@ -65,7 +65,7 @@ opts_chunk$set(cache = FALSE, out.extra = "", fig.pos = "H") # fig.align argument is not supported in Word (align in template docx) -if (knitr::opts_knit$get('rmarkdown.pandoc.to') == 'latex'){ +if (get_output_type() == 'latex'){ opts_chunk$set(fig.align = "center") } @@ -398,7 +398,7 @@ kable( The authors thank the following individuals for their invaluable contributions to this report. From [insert group name or affiliation, for example: the CAVIMC/Duke team] we thank [insert individual names, and roles here, for example: Kelli Greene and Hongmei Gao (Experimental Design, Data Interpretation, Study Management); Nicole Yates (Scientific Research Laboratory Manager) and Sheetal Sawant (Biostatistician)]. -From Fred Hutch Cancer Center, we also thank [insert names and roles here, for example: Ratana Som (SCHARP Lab Data Manager); Marie Vendettuoli and Valeria Duran (SCHARP Statistical Programmers); and Lindsey Mwoga and Drienna Holman (VISC Project Management)]. +From Fred Hutch Cancer Center, we also thank [insert names and roles here, for example: Ratana Som (SCHARP Lab Data Manager); Valeria Duran (SCHARP Statistical Programmer); and Lindsey Mwoga and Drienna Holman (VISC Project Management)]. Note: names may be listed in bullet point format instead of paragraph format if that helps with readability, for example: diff --git a/inst/templates/bibliography.bib b/inst/templates/bibliography.bib index f54d604a..0f824501 100644 --- a/inst/templates/bibliography.bib +++ b/inst/templates/bibliography.bib @@ -371,7 +371,7 @@ @article{Newton2004 } @article{Pollara2014, - author = {Pollara, J., Bonsignori, M. et al.}, + author = {Pollara, J. and Bonsignori, M. and Moody, A. M. and Liu, P. S. and Alam, M. and Hwang, K.K. and Gurley, T. and Kozink, D. M. and Armand, L. C. and Marshall, D. J. and Whitesides, J. F. and Kaewkungwal, J. and Nitayaphan, S. and Pitisuttithum, P. and Rerks-Ngarm, S. and Robb, M. L. and O'Connell, R. J. and Kim, J. H. and Michael, N. L. and Montefiori, D. C. and Tomaras, G. D. and Liao, H. X., and Haynes, B. F. and Ferrari, G.}, title = {HIV-1 vaccine-induced C1 and V2 Env-specific antibodies synergize for increased antiviral activities.}, journal = {J Virol.}, year = {2014}, @@ -379,6 +379,15 @@ @article{Pollara2014 pages = {7715-26} } +@article{Fisher2019, + author = {Fisher, L. and Zinter, M. and Stanfield-Oakley, S. and Carpp, L.N. and Edwards, R.W. and Denny, T. and Moodie, Z. and Laher, F. and Bekker, L.G. and McElrath, M.J. and Gilbert, P.B.}, + year = {2019}, + title = {{V}accine-induced antibodies mediate higher antibody-dependent cellular cytotoxicity after interleukin-15 pretreatment of natural killer effector cells.}, + journal = {{F}rontiers in {I}mmunology}, + volume = {10}, + pages = {2741} +} + @article{Sambor2014, author = {Sambor, A. et al.}, title = {Establishment and maintenance of a PBMC repository for functional cellular studies in support of clinical vaccine trials.}, @@ -390,13 +399,23 @@ @article{Sambor2014 @article{Pollara2011, author = {Pollara, J., Hart, L. et al.}, - title = {High-throughput quantitative analysis of HIV-1 and SIV-specific ADCC-mediating antibody responses.}, + title = {{H}igh-throughput quantitative analysis of {HIV}-1 and {SIV}-specific {ADCC}-mediating antibody responses.}, journal = {Cytometry A.}, year = {2011}, volume = {79(8)}, pages = {603-12} } +@article{Trkola1999, + author = {Trkola, A. and Matthews, J. and Gordon, C. and Ketas, T. and Moore, J. P.}, + title = {{A} {C}ell {L}ine {B}ased {N}eutralization {A}ssay for {P}rimary {H}uman {I}mmunodeficiency {V}irus {T}ype 1 {I}solates {T}hat {U}se {E}ither the {CCR}5 or the {CXCR}4 {C}oreceptor.}, + year = {1999}, + journal = {{J}ournal of {V}irology}, + volume = {73}, + number = {11}, + pages = {8966-8974} +} + @article{tomaras_polyclonal_2011, title = {Polyclonal B cell responses to conserved neutralization epitopes in a subset of HIV-1-infected individuals}, volume = {85}, @@ -457,3 +476,5 @@ @Manual{rlang year = {2020}, url = {https://www.R-project.org/} } + + diff --git a/inst/templates/methods-adcc/adcc-biological-endpoints.Rmd b/inst/templates/methods-adcc/adcc-biological-endpoints.Rmd new file mode 100644 index 00000000..11c979b3 --- /dev/null +++ b/inst/templates/methods-adcc/adcc-biological-endpoints.Rmd @@ -0,0 +1,14 @@ +--- +title: "biological-endpoints" +--- + + + + +## Biological Endpoints GTL + +ADCC-mediated antibody responses were measured using GranToxiLux (GTL) assays from specimens obtained at *[describe visits; include visit number, timepoint in weeks or months, and relation to SPA. E.g. week 26 (2 weeks post-4th vaccination, visit 10)]*. The GTL ADCC assay measures percent Granzyme B activity, defined as the percentage of antigen-coated target cells positive for proteolytically active Granzyme B out of the total viable target cell population. Endpoints are the response rate and magnitude of ADCC-mediated antibody responses against a panel of *[number of antigens]* HIV-1 antigens representing *[include description of viruses: those included in the vaccine product (vaccine-matched), Env matched in clade to vaccine products, and other Env to identify the breadth of the responses against HIV-1 subtypes]*. + +## Biological endpoints Luciferase + +ADCC-mediated antibody responses were measured using Luciferase ADCC assays from specimens obtained at *[describe visits; include visit number, timepoint in weeks or months, and relation to SPA. E.g. week 26 (2 weeks post-4th vaccination, visit 10)]*. The Luciferase ADCC assay tests reactivity against Infectious Molecular Clone (IMC)-infected target cells by measuring percent reduction in Relative Luminescence Units (RLUs), reported as percentage specific killing. Endpoints are the response rate and magnitude of ADCC-mediated antibody responses against a panel of *[number of IMCs]* HIV-1 IMC expressing Env representing *[include description of IMCs: those included in the vaccine product (vaccine-matched), Env matched in clade to vaccine products, and other Env to identify the breadth of the responses against HIV-1 subtypes]*. diff --git a/inst/templates/methods-adcc/adcc-lab-methods.Rmd b/inst/templates/methods-adcc/adcc-lab-methods.Rmd new file mode 100644 index 00000000..80c13499 --- /dev/null +++ b/inst/templates/methods-adcc/adcc-lab-methods.Rmd @@ -0,0 +1,28 @@ +--- +title: "lab-methods" +--- + + + + +## Lab Methods GTL + +The qualified GranToxiLux Antibody-Dependent Cell-Mediated Cytotoxicity (GTL-ADCC) assay was performed as previously described [@Pollara2014]. Target cells were a clonal isolate of the CEM.NKRCCR5 CD4+ T-cell line (NIH AIDS Reagent Program, Division of AIDS, NIAID, NIH: from Dr. Alexandra Trkola [@Trkola1999]. These cells were coated with recombinant gp120s representing the HIV-1 envelopes of the subtype [specify subtype and antigens, e.g. C (TV1 and 1086c)]. + +Effector cells were peripheral blood mononuclear cells (PBMCs) obtained from a HIV-seronegative donor heterozygous for Fc$\gamma$R3A at position 158 (158F/V). PBMCs were obtained by leukapheresis to collect enough cells for completion of the study with a single donation, minimizing potential effector cell population variability effects on the study outcome. + +PBMCs were used at an effector cell to target cell ratio of 30:1. Serum samples were tested after five-fold serial dilutions starting at 1:50 (1:50, 1:250, 1:1250, 1:6250, 1:31250, and 1:156250). Each plate has one standardized positive control in duplicate and one standardized negative control in duplicate. + +ADCC is quantified as net percent granzyme B activity, which is the percent of target cells positive for GTL (an indicator of granzyme B uptake) minus the percent of target cells positive for GTL when incubated with effector cells in the absence of a source of antibodies. Flow cytometry is used to quantify the frequency of granzyme B positive cells. + +## Lab Methods Luciferase + +We utilized a modified version of a previously published ADCC luciferase procedure [@Pollara2014; @Fisher2019] . Briefly, CEM.NKRCCR5 cells [@Trkola1999] were used as targets for ADCC luciferase assays after infection by one of the following HIV-1 [vaccine-matched, if all IMCs are vaccine-matched; if not, indicate match in table below] IMCs: +Complete IMC name Accession Number Abbreviated name Vaccine Match +[Full name, as uploaded by lab] [provided by lab] [SRA-derived abbreviated name shown in tables and figures] [if a mix of matched and unmatched IMCs were tested, indicate here which were matched] + +Peripheral blood mononuclear cells (PBMCs) were obtained from a HIV-seronegative donor by leukapheresis and cryopreserved until the day of the assay. After thawing and overnight resting in RPMI 1640 supplemented with antibiotics, $10\%$ fetal bovine serum (R10), and 10 ng/mL of IL-15, the PBMCs were used as effector cells at an effector-to-target ratio of 30:1. + +Target and effector cells were plated in white 96-well half-area plates and co-cultured with 4-fold serial dilutions of trial participant serum starting at the 1:50 dilution. For each sample, percent specific killing was measured in duplicate at dilutions of 1:50, 1:200, 1:800, 1:3200, 1:12800, and 1:51200. Co-cultures were incubated for 6 hours at $37^{\circ}$C in $5\%$ CO2. The final readout was the reduction of luminescence intensity generated by the presence of residual intact target cells that had not been lysed by the effector population in the presence of ADCC-mediating serum antibodies. The percentage of killing was calculated using the formula: percent specific killing = $100 * \frac{\text{(RLU of target and effector well– RLU of test well)}}{\text{RLU of target and effector well}}$. + +In this analysis, the Relative Luminescence Units (RLU) of the target plus effector wells represents spontaneous lysis in the absence of any source of antibody and is used to calculate background activity. The monoclonal antibody [insert antibody name from lab study plan, e.g. Synagis] and a cocktail of HIV-1 monoclonal antibodies [insert antibody names from lab study plan, e.g. (A32, 2G12, CH44, and 7B2)] were used as negative and positive controls, respectively. diff --git a/inst/templates/methods-adcc/adcc-statistical-methods.Rmd b/inst/templates/methods-adcc/adcc-statistical-methods.Rmd new file mode 100644 index 00000000..cd0130dd --- /dev/null +++ b/inst/templates/methods-adcc/adcc-statistical-methods.Rmd @@ -0,0 +1,50 @@ +--- +title: "statistical-methods" +--- + + + +## Statistical Endpoints GTL + +### Peak activity + +Peak net percent granzyme B activity defined as the maximum activity across the six dilution levels ("peak activity"). Peak activity less than 0\% is set to 0\%. + +### AUC + +Area under the net percent granzyme B activity ("AUC") versus log$_{10}$ (dilution) curve is calculated using the trapezoidal rule, setting any net percent granzyme B activity below 0\% to 0\%. + +### Response call + +A positive response is defined as peak activity greater than or equal to 8\%. Tables show positive response rates and corresponding 95\% confidence intervals calculated by the Wilson score method [@AgCo1998], as well as summary statistics among positive responders and both responders and non-responders [update as needed; must have a table of summary statistics for the same population as comparisons described below]. + + +## Statistical Endpoints Luciferase + +### Percent loss + +Percent specific killing was averaged over wells within participant, timepoint, and dilution. Baseline-subtracted percent loss activity was calculated for each dilution as baseline activity subtracted from post-baseline activity. Negative values were truncated at zero. + +### Peak percent loss + +Baseline-subtracted peak percent (\%) specific killing was defined as the maximum baseline-subtracted activity across the six dilution levels. + +### AUC + +Nonparametric partial Area under the baseline-subtracted curves ("pAUC"), calculated using the trapezoidal rule on three dilutions of the baseline-subtracted curves, setting baseline-subtracted percent specific killing less than 0\% to zero. + +### Response call + +A response is defined as positive if the baseline-subtracted percent (\%) specific killing activity is greater than or equal to 10\% for either the 1:50 or 1:200 dilutions. + +# Statistical Methods GTL and Luciferase + +## Graphical analysis + +Plots of peak activity and AUC show both response rates and the distribution of magnitude. Positive responses are indicated by dots color-coded by treatment group, and negative responses by gray triangles. A boxplot is superimposed on the distribution of positive responses. The mid-line of the box denotes the median and the ends of the box denote the $25^{th}$ and $75^{th}$ percentiles. The whiskers that extend from the top and bottom of the box extend to the most extreme data points that are no more than 1.5 times the interquartile range (i.e., height of the box) or if no value meets this criterion, to the data extremes. + +*[If working with durability data and calculating fold change from peak, be sure to specify direction of difference, e.g. $\text{log10(durability visit)} - \text{log10(peak visit)}$.]* + +## Statistical tests + +*[If statistical tests are used to compare responses, describe here. Follow protocol and assay specific SAP, converting the language to past tense. Generally, response rates are compared between groups using Barnard's test, and response are compared using Wilcoxon rank sum tests. Typically, two sets of magnitude comparisons are done: restricted to positive responders only, and all data i.e. positive and nonresponders.]* diff --git a/man/use_visc_methods.Rd b/man/use_visc_methods.Rd index 57a6cd2f..7b059b9d 100644 --- a/man/use_visc_methods.Rd +++ b/man/use_visc_methods.Rd @@ -6,14 +6,14 @@ \usage{ use_visc_methods( path = ".", - assay = c("generic", "bama", "nab"), + assay = c("generic", "bama", "nab", "adcc"), interactive = TRUE ) } \arguments{ \item{path}{path within the active project} -\item{assay}{"bama" or "generic"} +\item{assay}{"generic", "bama", "nab" or "adcc"} \item{interactive}{TRUE by default. FALSE is for non-interactive unit testing only.} diff --git a/man/use_visc_report.Rd b/man/use_visc_report.Rd index b8f0799c..086cd8fd 100644 --- a/man/use_visc_report.Rd +++ b/man/use_visc_report.Rd @@ -5,9 +5,9 @@ \title{Use a VISC Report Template} \usage{ use_visc_report( - report_name = "PT-Report", + report_name = "PTreport", path = ".", - report_type = c("empty", "generic", "bama", "nab"), + report_type = c("empty", "generic", "bama", "nab", "adcc"), interactive = TRUE ) } @@ -16,7 +16,7 @@ use_visc_report( \item{path}{path of the file within the active project} -\item{report_type}{"empty", "generic", "bama", or "nab"} +\item{report_type}{"empty", "generic", "bama", "nab", or "adcc"} \item{interactive}{TRUE by default. FALSE is for non-interactive unit testing only.} diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index 884979a2..c4f005b5 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -15,7 +15,7 @@ #' @return Side effects only. test_knit_report <- function(report_type, outfile_ext){ stopifnot( - report_type %in% c('generic', 'empty', 'bama', 'nab'), + report_type %in% c('generic', 'empty', 'bama', 'nab', 'adcc'), outfile_ext %in% c('pdf', 'docx') ) report_name <- paste(report_type, outfile_ext, 'report', sep = '_') diff --git a/tests/testthat/test-create_visc_project.R b/tests/testthat/test-create_visc_project.R new file mode 100644 index 00000000..1d943285 --- /dev/null +++ b/tests/testthat/test-create_visc_project.R @@ -0,0 +1,15 @@ +test_that("create_visc_project works", { + # creates ephemeral directory that will be deleted upon function exit + temp_dir <- withr::local_tempdir() + create_visc_project(temp_dir, interactive = FALSE) + # check that proper README files got rendered and deleted + expect_true( + file.exists(file.path(temp_dir, 'README.md')) + ) + expect_false( + file.exists(file.path(temp_dir, 'README.Rmd')) + ) + expect_false( + file.exists(file.path(temp_dir, 'README.html')) + ) +}) diff --git a/tests/testthat/test-use_visc_report.R b/tests/testthat/test-use_visc_report.R index fa07d0e6..5316610a 100644 --- a/tests/testthat/test-use_visc_report.R +++ b/tests/testthat/test-use_visc_report.R @@ -38,7 +38,7 @@ test_that("use_visc_report() creates missing subdirectory", { # # This sets a custom test context(), so should go last in this test file local({ - for (report_type in c('generic', 'empty', 'bama', 'nab')){ + for (report_type in c('generic', 'empty', 'bama', 'nab', 'adcc')){ for (output_ext in c('pdf', 'docx')){ test_knit_report(report_type, output_ext) } diff --git a/tests/testthat/test-visc_load_pdata.R b/tests/testthat/test-visc_load_pdata.R index d7ad9d1b..5f57c6d7 100644 --- a/tests/testthat/test-visc_load_pdata.R +++ b/tests/testthat/test-visc_load_pdata.R @@ -78,7 +78,7 @@ test_that("visc_load_pdata works", { '3ccb5b0aaa74fe7cfc0d3ca6ab0b5cf3' ) }), - "Unable to find data object file" + "Unable to find data object.*" ) }) }) diff --git a/vignettes/using_pdf_and_word_template.Rmd b/vignettes/using_pdf_and_word_template.Rmd index 4a4d277a..5417b805 100644 --- a/vignettes/using_pdf_and_word_template.Rmd +++ b/vignettes/using_pdf_and_word_template.Rmd @@ -21,7 +21,7 @@ To use a VISC report template, run: ```{r eval=FALSE} use_visc_report( - report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file + report_name = "VDCnnn_BAMA_PTreport_interim_blinded", # the name of the report file path = "BAMA", # the path within the active directory, usually the name of the assay report_type = "bama" # "empty", "generic", "bama", or "nab" ) @@ -33,9 +33,9 @@ example above, this structure looks like: ``` |- BAMA/ -| +- VDCnnn_BAMA_PT_Report_statusifapplicable/ -| +- BAMA-PT-Report.Rmd # VISC report template -| +- methods/ # folder with "child" .Rmd documents +| +- VDCnnn_BAMA_PTreport_interim_blinded/ +| +- VDCnnn_BAMA_PTreport_interim_blinded.Rmd # VISC report template +| +- methods/ # folder with "child" .Rmd documents | +- biological-endpoints.Rmd | +- lab-methods.Rmd | +- statistical-methods.Rmd