Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: '4.0.4', pandoc-version: '2.11.4'}
- {os: ubuntu-latest, r: '4.4.2', pandoc-version: '3.2'}
- {os: ubuntu-latest, r: '4.1.0', pandoc-version: '2.11.4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -31,14 +32,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup statsrv pandoc
if: ${{ matrix.config.r == '4.0.4' }}
- name: Setup custom pandoc version
if: ${{ matrix.config.pandoc-version != null }}
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: ${{ matrix.config.pandoc-version }}

- name: Setup default pandoc
if: ${{ matrix.config.r != '4.0.4' }}
- name: Setup default pandoc version
if: ${{ matrix.config.pandoc-version == null }}
uses: r-lib/actions/setup-pandoc@v2

- name: Set up tinytex
Expand All @@ -53,15 +54,15 @@ jobs:

- name: Setup recent R
uses: r-lib/actions/setup-r@v2
if: ${{ matrix.config.r != '4.0.4' }}
if: ${{ matrix.config.r != '4.1.0' && matrix.config.r != '4.4.2'}}
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Setup R 4.0.4
- name: Setup older R
uses: r-lib/actions/setup-r@v2
if: ${{ matrix.config.r == '4.0.4' }}
if: ${{ matrix.config.r == '4.1.0' || matrix.config.r == '4.4.2'}}
with:
r-version: ${{ matrix.config.r }}
cran: 'https://packagemanager.posit.co/cran/__linux__/noble/2024-04-19'
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Description:
Statistical, data processing, and annotation functions for VISC.
License: MIT + file LICENSE
Depends:
R (>= 3.5)
R (>= 4.1.0)
Imports:
binom,
coin,
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# VISCfunctions (development version)

* Maintenance of package and CI (#114)
* Report loaded and attached packages in package reproducibility table (#132)
* Report nodename in platform reproducibility table (#121)
* Add B cell example dataset from G001 flow and sequencing file (#108)
* Maintenance of package and CI (#114, #116, #124)
* VISCfunctions now depends on R >= 4.1.0 (#134)
* Auto-generate VISCfunctions pkgdown website with GitHub Actions (#119)

# VISCfunctions 1.3.0

Expand Down
4 changes: 2 additions & 2 deletions R/collapse_group_row.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#'
#' library(dplyr)
#' options(knitr.kable.NA = '')
#' collapse_group_row(sample_df, x, y, z) %>%
#' kableExtra::kable() %>%
#' collapse_group_row(sample_df, x, y, z) |>
#' kableExtra::kable() |>
#' kableExtra::kable_styling()
#' @export
collapse_group_row <- function(.data, ..., reorder_cols = TRUE) {
Expand Down
38 changes: 19 additions & 19 deletions R/pairwise_comparisons.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
#' data(exampleData_BAMA)
#'
#' ## Group Comparison
#'group_testing_tibble <- exampleData_BAMA %>%
#' group_by(antigen, visitno) %>%
#'group_testing_tibble <- exampleData_BAMA |>
#' group_by(antigen, visitno) |>
#' reframe(pairwise_test_cont(x = magnitude,
#' group = group,
#' paired = FALSE,
Expand All @@ -97,8 +97,8 @@
#'
#'
#' ## Timepoint Comparison
#'timepoint_testing_dt <- exampleData_BAMA %>%
#' group_by(antigen, group) %>%
#'timepoint_testing_dt <- exampleData_BAMA |>
#' group_by(antigen, group) |>
#' reframe(pairwise_test_cont(x = magnitude,
#' group = visitno,
#' paired = TRUE,
Expand All @@ -118,8 +118,8 @@
#'
#' ## Group Comparison
#' # using dplyr
#'exampleData_ICS %>%
#'group_by(Stim, Parent, Population, Visit) %>%
#'exampleData_ICS |>
#'group_by(Stim, Parent, Population, Visit) |>
#'reframe(pairwise_test_cont(x = PercentCellNet,
#' group = Group,
#' paired = FALSE,
Expand All @@ -133,8 +133,8 @@
#' verbose = TRUE))
#'
#' # Timepoint Comparison
#'timepoint_testing_dt <- exampleData_ICS %>%
#' group_by(Stim, Parent, Population, Group) %>%
#'timepoint_testing_dt <- exampleData_ICS |>
#' group_by(Stim, Parent, Population, Group) |>
#' reframe(pairwise_test_cont(x = PercentCellNet,
#' group = Visit,
#' paired = TRUE,
Expand Down Expand Up @@ -474,8 +474,8 @@ pairwise_test_cont <- function(
#' data(exampleData_BAMA)
#'
#' ## Group Comparison
#'group_testing <- exampleData_BAMA %>%
#' group_by(antigen, visitno) %>%
#'group_testing <- exampleData_BAMA |>
#' group_by(antigen, visitno) |>
#' group_modify(~ as.data.frame(
#' pairwise_test_bin(x = .$response, group = .$group,
#' method = 'barnard', alternative = 'less',
Expand All @@ -484,8 +484,8 @@ pairwise_test_cont <- function(
#'
#'
#' ## Timepoint Comparison
#'timepoint_testing <- exampleData_BAMA %>%
#' group_by(antigen, group) %>%
#'timepoint_testing <- exampleData_BAMA |>
#' group_by(antigen, group) |>
#' group_modify(~ as.data.frame(
#' pairwise_test_bin(x = .$response, group = .$visitno, id = .$pubID,
#' method = 'mcnemar', num_needed_for_test = 3, digits = 1,
Expand All @@ -495,16 +495,16 @@ pairwise_test_cont <- function(
#' data(exampleData_ICS)
#'
#' ## Group Comparison
#'group_testing <- exampleData_ICS %>%
#' group_by(Stim, Parent, Population, Visit) %>%
#'group_testing <- exampleData_ICS |>
#' group_by(Stim, Parent, Population, Visit) |>
#' group_modify(~ as.data.frame(
#' pairwise_test_bin(x = .$response, group = .$Group , alternative = 'greater',
#' method = 'barnard', num_needed_for_test = 3, digits = 1,
#' trailing_zeros = TRUE, sep_val = ' vs. ', verbose = TRUE)))
#'
#' ## Timepoint Comparison
#'timepoint_testing <- exampleData_ICS %>%
#' group_by(Stim, Parent, Population, Group) %>%
#'timepoint_testing <- exampleData_ICS |>
#' group_by(Stim, Parent, Population, Group) |>
#' group_modify(~ as.data.frame(
#' pairwise_test_bin(x = .$response, group = .$Visit, id = .$pubID,
#' method = 'mcnemar', num_needed_for_test = 3, digits = 1,
Expand Down Expand Up @@ -771,9 +771,9 @@ pairwise_test_bin <- function(x,
#' data(exampleData_BAMA)
#'
#' ## Antigen Correlation
#' exampleData_BAMA %>%
#' filter(visitno != 0) %>%
#' group_by(group, visitno) %>%
#' exampleData_BAMA |>
#' filter(visitno != 0) |>
#' group_by(group, visitno) |>
#' summarize(
#' cor_test_pairs(x = magnitude, pair = antigen, id = pubID,
#' method = 'spearman', n_distinct_value = 3, digits = 1, verbose = TRUE),
Expand Down
24 changes: 12 additions & 12 deletions R/pretty_output_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#' library(tidyr)
#' data(exampleData_BAMA)
#'
#' descriptive_stats_by_group <- exampleData_BAMA %>%
#' group_by(visitno,antigen) %>%
#' descriptive_stats_by_group <- exampleData_BAMA |>
#' group_by(visitno,antigen) |>
#' reframe(
#' Group1 = unique(group[group == 1]), Group2 = unique(group[group == 2]),
#' Group1_n = length(magnitude[group == 1]), Group2_n = length(magnitude[group == 2]),
Expand All @@ -70,16 +70,16 @@
#' # Same example wit tidyverse in single pipe
#'
#'
#'exampleData_BAMA %>%
#' mutate(group = paste0("Group", group)) %>%
#' group_by(group, visitno, antigen) %>%
#'exampleData_BAMA |>
#' mutate(group = paste0("Group", group)) |>
#' group_by(group, visitno, antigen) |>
#' reframe(N = n(), mean = mean(magnitude), sd = sd(magnitude),
#' median = median(magnitude), min = min(magnitude),
#' max = max(magnitude), q95_fun = quantile(magnitude, 0.95)) %>%
#' pivot_longer(-(group:antigen)) %>% # these three chains create a wide dataset
#' unite(temp, group, name) %>%
#' pivot_wider(names_from = temp, values_from = value) %>%
#' mutate(Group1 = "Group 1", Group2 = "Group 2") %>%
#' max = max(magnitude), q95_fun = quantile(magnitude, 0.95)) |>
#' pivot_longer(-(group:antigen)) |> # these three chains create a wide dataset
#' unite(temp, group, name) |>
#' pivot_wider(names_from = temp, values_from = value) |>
#' mutate(Group1 = "Group 1", Group2 = "Group 2") |>
#' paste_tbl_grp()
#'
#' @export
Expand Down Expand Up @@ -310,8 +310,8 @@ paste_tbl_grp <- function(
#' stat_paste(c(rep(5,5),NA),c(1:5,NA),c(1,NA,2,NA,3,NA),bound_char = '[')
#'
#' library(dplyr)
#' exampleData_BAMA %>%
#' group_by(antigen, visitno, group) %>%
#' exampleData_BAMA |>
#' group_by(antigen, visitno, group) |>
#' summarise(median_min_max = stat_paste(median(magnitude, na.rm = TRUE),
#' min(magnitude, na.rm = TRUE),
#' max(magnitude, na.rm = TRUE)),
Expand Down
8 changes: 4 additions & 4 deletions R/reproducibility_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ get_full_name <- function(id = NULL){
#'
#' # Simple HTML Display
#' kableExtra::kable(my_session_info$platform_table, 'html',
#' caption = "Reproducibility Software Session Information") %>%
#' caption = "Reproducibility Software Session Information") |>
#' kableExtra::kable_styling()
#'
#' kableExtra::kable(my_session_info$packages_table, 'html',
#' caption = "Reproducibility Software Package Version Information") %>%
#' caption = "Reproducibility Software Package Version Information") |>
#' kableExtra::kable_styling()
#'
#'
#' # Latex Display
#' kableExtra::kable(my_session_info$platform_table, 'latex', booktabs = TRUE,
#' linesep = '', caption = "Reproducibility Software Session Information") %>%
#' linesep = '', caption = "Reproducibility Software Session Information") |>
#' kableExtra::kable_styling(font_size = 7)
#'
#' kableExtra::kable(my_session_info$packages_table, 'latex', booktabs = TRUE,
#' linesep = '', caption = "Reproducibility Software Package Version Information") %>%
#' linesep = '', caption = "Reproducibility Software Package Version Information") |>
#' kableExtra::kable_styling(font_size = 7)
#'
#' @export
Expand Down
28 changes: 14 additions & 14 deletions R/step_curves.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@
#' event = c(1,1,0,1,1,0,0,1,1,1),
#' ptid = c(1,1,2,2,3,3,3,3,3,3))
#' plot_data <-
#' dat %>%
#' dplyr::group_by(ptid) %>%
#' dat |>
#' dplyr::group_by(ptid) |>
#' dplyr::group_modify(~ create_step_curve(x = .x$x, event = .x$event))
#'
#' ggplot2::ggplot(data = plot_data,
#' ggplot2::aes(x = time, y = surv, color = factor(ptid))) +
#' ggplot2::geom_step(linetype = "dashed", direction = 'hv', lwd = .35) +
#' ggplot2::geom_point(data = plot_data %>% filter(n.censor == 1),
#' ggplot2::geom_point(data = plot_data |> filter(n.censor == 1),
#' shape = 3, size = 6, show.legend = FALSE)
#'
#' #mAB example for reverse curves
#' data(CAVD812_mAB)
#'
#' plot_data <-
#' CAVD812_mAB %>%
#' filter(virus != 'SVA-MLV') %>%
#' tidyr::pivot_longer(cols = c(ic50, ic80)) %>%
#' dplyr::group_by(name, product) %>%
#' CAVD812_mAB |>
#' filter(virus != 'SVA-MLV') |>
#' tidyr::pivot_longer(cols = c(ic50, ic80)) |>
#' dplyr::group_by(name, product) |>
#' dplyr::group_modify(~ create_step_curve(x = pmin(.x$value, 100),
#' event = as.numeric(.x$value < 50),
#' flip_surv = TRUE,
Expand Down Expand Up @@ -160,8 +160,8 @@ create_step_curve <- function(x,
#' response = c(1,1,0,1,1,0,0,1,1,1),
#' ptid = c(1,1,2,2,3,3,3,3,3,3))
#' ind_results <-
#' dat %>%
#' dplyr::group_by(ptid) %>%
#' dat |>
#' dplyr::group_by(ptid) |>
#' dplyr::group_modify(~ mb_results(magnitude = .x$magnitude, response = .x$response))
#'
#' overall_results <-
Expand All @@ -179,17 +179,17 @@ create_step_curve <- function(x,
#' data(exampleData_BAMA)
#'
#' data_here <-
#' exampleData_BAMA %>%
#' exampleData_BAMA |>
#' filter(visitno == 2)
#'
#' group_results <-
#' data_here %>%
#' dplyr::group_by(group) %>%
#' data_here |>
#' dplyr::group_by(group) |>
#' dplyr::group_modify(~ mb_results(magnitude = .x$magnitude , response = .x$response))
#'
#' ind_results <-
#' data_here %>%
#' dplyr::group_by(group, pubID) %>%
#' data_here |>
#' dplyr::group_by(group, pubID) |>
#' dplyr::group_modify(~ mb_results(magnitude = .x$magnitude , response = .x$response))
#'
#' ggplot2::ggplot(data = group_results,
Expand Down
4 changes: 2 additions & 2 deletions data-raw/cds_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ library(DataSpaceR)
con <- connectDS()

cvd812 <- con$getStudy('cvd812')
CAVD812_mAB <- cvd812$getDataset("NAB Ig") %>%
CAVD812_mAB <- cvd812$getDataset("NAB Ig") |>
distinct(
product = mab_name_source,
virus = cds_virus_name,
ic50 = titer_curve_ic50,
ic80 = titer_curve_ic80
) %>% as.data.frame()
) |> as.data.frame()

usethis::use_data(CAVD812_mAB, overwrite = TRUE)

Loading