Skip to content

Commit 4c7790f

Browse files
committed
Merge branch 'develop' into lemireg-add_quartiles-pairwise_test_cont
2 parents 36584f5 + 9b3241b commit 4c7790f

25 files changed

+352
-339
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
- {os: windows-latest, r: 'release'}
2323
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2424
- {os: ubuntu-latest, r: 'release'}
25-
- {os: ubuntu-latest, r: '4.0.4', pandoc-version: '2.11.4'}
25+
- {os: ubuntu-latest, r: '4.4.2', pandoc-version: '3.2'}
26+
- {os: ubuntu-latest, r: '4.1.0', pandoc-version: '2.11.4'}
2627

2728
env:
2829
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -31,14 +32,14 @@ jobs:
3132
steps:
3233
- uses: actions/checkout@v4
3334

34-
- name: Setup statsrv pandoc
35-
if: ${{ matrix.config.r == '4.0.4' }}
35+
- name: Setup custom pandoc version
36+
if: ${{ matrix.config.pandoc-version != null }}
3637
uses: r-lib/actions/setup-pandoc@v2
3738
with:
3839
pandoc-version: ${{ matrix.config.pandoc-version }}
3940

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

4445
- name: Set up tinytex
@@ -53,15 +54,15 @@ jobs:
5354
5455
- name: Setup recent R
5556
uses: r-lib/actions/setup-r@v2
56-
if: ${{ matrix.config.r != '4.0.4' }}
57+
if: ${{ matrix.config.r != '4.1.0' && matrix.config.r != '4.4.2'}}
5758
with:
5859
r-version: ${{ matrix.config.r }}
5960
http-user-agent: ${{ matrix.config.http-user-agent }}
6061
use-public-rspm: true
6162

62-
- name: Setup R 4.0.4
63+
- name: Setup older R
6364
uses: r-lib/actions/setup-r@v2
64-
if: ${{ matrix.config.r == '4.0.4' }}
65+
if: ${{ matrix.config.r == '4.1.0' || matrix.config.r == '4.4.2'}}
6566
with:
6667
r-version: ${{ matrix.config.r }}
6768
cran: 'https://packagemanager.posit.co/cran/__linux__/noble/2024-04-19'

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: VISCfunctions
33
Title: VISC STP/SRA functions
4-
Version: 1.3.0.9000
4+
Version: 1.3.1.9000
55
Authors@R: c(
66
person("Bryan", "Mayer", , "bmayer@fredhutch.org", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2258-5276")),
77
person("Dave", "Slager", , "dslager@fredhutch.org", role = "aut", comment = c(ORCID = "0000-0003-2525-2039")),
@@ -18,7 +18,7 @@ Description:
1818
Statistical, data processing, and annotation functions for VISC.
1919
License: MIT + file LICENSE
2020
Depends:
21-
R (>= 3.5)
21+
R (>= 4.1.0)
2222
Imports:
2323
binom,
2424
coin,

NEWS.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# VISCfunctions (development version)
22

33
* Add `Median_Quartiles` to `pairwise_test_cont()` output (#99)
4-
* Maintenance of package and CI (#114)
5-
* Add B cell example dataset from G001 flow and sequencing file (#108)
64
* Minor Changes:
75
* Update `Overview()` to include new `Median_Quartiles` (#99)
86

7+
# VISCfunctions 1.3.1
8+
9+
* Report loaded and attached packages in package reproducibility table (#132)
10+
* Report nodename in platform reproducibility table (#121)
11+
* Add B cell example dataset from G001 flow and sequencing file (#108)
12+
* Maintenance of package and CI (#114, #116, #124)
13+
* VISCfunctions now depends on R >= 4.1.0 (#134)
14+
* Auto-generate VISCfunctions pkgdown website with GitHub Actions (#119)
15+
916
# VISCfunctions 1.3.0
1017

1118
* Fix bug in `pairwise_test_bin()` and `pairwise_test_cont()` (#111)

R/collapse_group_row.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#'
2020
#' library(dplyr)
2121
#' options(knitr.kable.NA = '')
22-
#' collapse_group_row(sample_df, x, y, z) %>%
23-
#' kableExtra::kable() %>%
22+
#' collapse_group_row(sample_df, x, y, z) |>
23+
#' kableExtra::kable() |>
2424
#' kableExtra::kable_styling()
2525
#' @export
2626
collapse_group_row <- function(.data, ..., reorder_cols = TRUE) {

R/pairwise_comparisons.R

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
#' data(exampleData_BAMA)
8484
#'
8585
#' ## Group Comparison
86-
#'group_testing_tibble <- exampleData_BAMA %>%
87-
#' group_by(antigen, visitno) %>%
86+
#'group_testing_tibble <- exampleData_BAMA |>
87+
#' group_by(antigen, visitno) |>
8888
#' reframe(pairwise_test_cont(x = magnitude,
8989
#' group = group,
9090
#' paired = FALSE,
@@ -97,8 +97,8 @@
9797
#'
9898
#'
9999
#' ## Timepoint Comparison
100-
#'timepoint_testing_dt <- exampleData_BAMA %>%
101-
#' group_by(antigen, group) %>%
100+
#'timepoint_testing_dt <- exampleData_BAMA |>
101+
#' group_by(antigen, group) |>
102102
#' reframe(pairwise_test_cont(x = magnitude,
103103
#' group = visitno,
104104
#' paired = TRUE,
@@ -118,8 +118,8 @@
118118
#'
119119
#' ## Group Comparison
120120
#' # using dplyr
121-
#'exampleData_ICS %>%
122-
#'group_by(Stim, Parent, Population, Visit) %>%
121+
#'exampleData_ICS |>
122+
#'group_by(Stim, Parent, Population, Visit) |>
123123
#'reframe(pairwise_test_cont(x = PercentCellNet,
124124
#' group = Group,
125125
#' paired = FALSE,
@@ -133,8 +133,8 @@
133133
#' verbose = TRUE))
134134
#'
135135
#' # Timepoint Comparison
136-
#'timepoint_testing_dt <- exampleData_ICS %>%
137-
#' group_by(Stim, Parent, Population, Group) %>%
136+
#'timepoint_testing_dt <- exampleData_ICS |>
137+
#' group_by(Stim, Parent, Population, Group) |>
138138
#' reframe(pairwise_test_cont(x = PercentCellNet,
139139
#' group = Visit,
140140
#' paired = TRUE,
@@ -483,8 +483,8 @@ pairwise_test_cont <- function(
483483
#' data(exampleData_BAMA)
484484
#'
485485
#' ## Group Comparison
486-
#'group_testing <- exampleData_BAMA %>%
487-
#' group_by(antigen, visitno) %>%
486+
#'group_testing <- exampleData_BAMA |>
487+
#' group_by(antigen, visitno) |>
488488
#' group_modify(~ as.data.frame(
489489
#' pairwise_test_bin(x = .$response, group = .$group,
490490
#' method = 'barnard', alternative = 'less',
@@ -493,8 +493,8 @@ pairwise_test_cont <- function(
493493
#'
494494
#'
495495
#' ## Timepoint Comparison
496-
#'timepoint_testing <- exampleData_BAMA %>%
497-
#' group_by(antigen, group) %>%
496+
#'timepoint_testing <- exampleData_BAMA |>
497+
#' group_by(antigen, group) |>
498498
#' group_modify(~ as.data.frame(
499499
#' pairwise_test_bin(x = .$response, group = .$visitno, id = .$pubID,
500500
#' method = 'mcnemar', num_needed_for_test = 3, digits = 1,
@@ -504,16 +504,16 @@ pairwise_test_cont <- function(
504504
#' data(exampleData_ICS)
505505
#'
506506
#' ## Group Comparison
507-
#'group_testing <- exampleData_ICS %>%
508-
#' group_by(Stim, Parent, Population, Visit) %>%
507+
#'group_testing <- exampleData_ICS |>
508+
#' group_by(Stim, Parent, Population, Visit) |>
509509
#' group_modify(~ as.data.frame(
510510
#' pairwise_test_bin(x = .$response, group = .$Group , alternative = 'greater',
511511
#' method = 'barnard', num_needed_for_test = 3, digits = 1,
512512
#' trailing_zeros = TRUE, sep_val = ' vs. ', verbose = TRUE)))
513513
#'
514514
#' ## Timepoint Comparison
515-
#'timepoint_testing <- exampleData_ICS %>%
516-
#' group_by(Stim, Parent, Population, Group) %>%
515+
#'timepoint_testing <- exampleData_ICS |>
516+
#' group_by(Stim, Parent, Population, Group) |>
517517
#' group_modify(~ as.data.frame(
518518
#' pairwise_test_bin(x = .$response, group = .$Visit, id = .$pubID,
519519
#' method = 'mcnemar', num_needed_for_test = 3, digits = 1,
@@ -780,9 +780,9 @@ pairwise_test_bin <- function(x,
780780
#' data(exampleData_BAMA)
781781
#'
782782
#' ## Antigen Correlation
783-
#' exampleData_BAMA %>%
784-
#' filter(visitno != 0) %>%
785-
#' group_by(group, visitno) %>%
783+
#' exampleData_BAMA |>
784+
#' filter(visitno != 0) |>
785+
#' group_by(group, visitno) |>
786786
#' summarize(
787787
#' cor_test_pairs(x = magnitude, pair = antigen, id = pubID,
788788
#' method = 'spearman', n_distinct_value = 3, digits = 1, verbose = TRUE),

R/pretty_output_functions.R

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#' library(tidyr)
4545
#' data(exampleData_BAMA)
4646
#'
47-
#' descriptive_stats_by_group <- exampleData_BAMA %>%
48-
#' group_by(visitno,antigen) %>%
47+
#' descriptive_stats_by_group <- exampleData_BAMA |>
48+
#' group_by(visitno,antigen) |>
4949
#' reframe(
5050
#' Group1 = unique(group[group == 1]), Group2 = unique(group[group == 2]),
5151
#' Group1_n = length(magnitude[group == 1]), Group2_n = length(magnitude[group == 2]),
@@ -70,16 +70,16 @@
7070
#' # Same example wit tidyverse in single pipe
7171
#'
7272
#'
73-
#'exampleData_BAMA %>%
74-
#' mutate(group = paste0("Group", group)) %>%
75-
#' group_by(group, visitno, antigen) %>%
73+
#'exampleData_BAMA |>
74+
#' mutate(group = paste0("Group", group)) |>
75+
#' group_by(group, visitno, antigen) |>
7676
#' reframe(N = n(), mean = mean(magnitude), sd = sd(magnitude),
7777
#' median = median(magnitude), min = min(magnitude),
78-
#' max = max(magnitude), q95_fun = quantile(magnitude, 0.95)) %>%
79-
#' pivot_longer(-(group:antigen)) %>% # these three chains create a wide dataset
80-
#' unite(temp, group, name) %>%
81-
#' pivot_wider(names_from = temp, values_from = value) %>%
82-
#' mutate(Group1 = "Group 1", Group2 = "Group 2") %>%
78+
#' max = max(magnitude), q95_fun = quantile(magnitude, 0.95)) |>
79+
#' pivot_longer(-(group:antigen)) |> # these three chains create a wide dataset
80+
#' unite(temp, group, name) |>
81+
#' pivot_wider(names_from = temp, values_from = value) |>
82+
#' mutate(Group1 = "Group 1", Group2 = "Group 2") |>
8383
#' paste_tbl_grp()
8484
#'
8585
#' @export
@@ -332,8 +332,8 @@ paste_tbl_grp <- function(
332332
#' stat_paste(c(rep(5,5),NA),c(1:5,NA),c(1,NA,2,NA,3,NA),bound_char = '[')
333333
#'
334334
#' library(dplyr)
335-
#' exampleData_BAMA %>%
336-
#' group_by(antigen, visitno, group) %>%
335+
#' exampleData_BAMA |>
336+
#' group_by(antigen, visitno, group) |>
337337
#' summarise(median_min_max = stat_paste(median(magnitude, na.rm = TRUE),
338338
#' min(magnitude, na.rm = TRUE),
339339
#' max(magnitude, na.rm = TRUE)),

R/reproducibility_tables.R

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ get_full_name <- function(id = NULL){
9999
#'
100100
#' # Simple HTML Display
101101
#' kableExtra::kable(my_session_info$platform_table, 'html',
102-
#' caption = "Reproducibility Software Session Information") %>%
102+
#' caption = "Reproducibility Software Session Information") |>
103103
#' kableExtra::kable_styling()
104104
#'
105105
#' kableExtra::kable(my_session_info$packages_table, 'html',
106-
#' caption = "Reproducibility Software Package Version Information") %>%
106+
#' caption = "Reproducibility Software Package Version Information") |>
107107
#' kableExtra::kable_styling()
108108
#'
109109
#'
110110
#' # Latex Display
111111
#' kableExtra::kable(my_session_info$platform_table, 'latex', booktabs = TRUE,
112-
#' linesep = '', caption = "Reproducibility Software Session Information") %>%
112+
#' linesep = '', caption = "Reproducibility Software Session Information") |>
113113
#' kableExtra::kable_styling(font_size = 7)
114114
#'
115115
#' kableExtra::kable(my_session_info$packages_table, 'latex', booktabs = TRUE,
116-
#' linesep = '', caption = "Reproducibility Software Package Version Information") %>%
116+
#' linesep = '', caption = "Reproducibility Software Package Version Information") |>
117117
#' kableExtra::kable_styling(font_size = 7)
118118
#'
119119
#' @export
@@ -127,10 +127,8 @@ get_session_info <- function(libpath = FALSE){
127127
Sys.getenv("USERNAME"),
128128
Sys.getenv("USER")))
129129

130-
my_session_info <- sessioninfo::session_info()
131-
132-
platform <- my_session_info[[1]]
133-
packages <- my_session_info[[2]]
130+
platform <- sessioninfo::platform_info()
131+
packages <- sessioninfo::package_info(pkgs = 'loaded', include_base = FALSE)
134132

135133
# TABLE 1
136134
my_session_info1 <- rbind(
@@ -222,8 +220,8 @@ get_session_info <- function(libpath = FALSE){
222220

223221

224222
# TABLE 2
225-
my_session_info2 <- packages[packages$attached,] # Only want attached packages
226-
my_session_info2 <- with(my_session_info2, {
223+
224+
my_session_info2 <- with(packages, {
227225
data.frame(package = package,
228226
version = loadedversion,
229227
# Pulling in Data Version numbers
@@ -238,6 +236,7 @@ get_session_info <- function(libpath = FALSE){
238236
USE.NAMES = FALSE),
239237
date = date,
240238
source = source,
239+
status = ifelse(attached, 'attached', 'loaded'),
241240
libpath = library)
242241
})
243242
if (! libpath) my_session_info2$libpath <- NULL
@@ -248,6 +247,9 @@ get_session_info <- function(libpath = FALSE){
248247
# Use short git hash
249248
my_session_info2$source <- shorten_git_hash(my_session_info2$source)
250249

250+
my_session_info2 <- my_session_info2[order(my_session_info2$status),]
251+
rownames(my_session_info2) <- NULL
252+
251253
list(platform_table = my_session_info1, packages_table = my_session_info2)
252254
}
253255

R/step_curves.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@
3434
#' event = c(1,1,0,1,1,0,0,1,1,1),
3535
#' ptid = c(1,1,2,2,3,3,3,3,3,3))
3636
#' plot_data <-
37-
#' dat %>%
38-
#' dplyr::group_by(ptid) %>%
37+
#' dat |>
38+
#' dplyr::group_by(ptid) |>
3939
#' dplyr::group_modify(~ create_step_curve(x = .x$x, event = .x$event))
4040
#'
4141
#' ggplot2::ggplot(data = plot_data,
4242
#' ggplot2::aes(x = time, y = surv, color = factor(ptid))) +
4343
#' ggplot2::geom_step(linetype = "dashed", direction = 'hv', lwd = .35) +
44-
#' ggplot2::geom_point(data = plot_data %>% filter(n.censor == 1),
44+
#' ggplot2::geom_point(data = plot_data |> filter(n.censor == 1),
4545
#' shape = 3, size = 6, show.legend = FALSE)
4646
#'
4747
#' #mAB example for reverse curves
4848
#' data(CAVD812_mAB)
4949
#'
5050
#' plot_data <-
51-
#' CAVD812_mAB %>%
52-
#' filter(virus != 'SVA-MLV') %>%
53-
#' tidyr::pivot_longer(cols = c(ic50, ic80)) %>%
54-
#' dplyr::group_by(name, product) %>%
51+
#' CAVD812_mAB |>
52+
#' filter(virus != 'SVA-MLV') |>
53+
#' tidyr::pivot_longer(cols = c(ic50, ic80)) |>
54+
#' dplyr::group_by(name, product) |>
5555
#' dplyr::group_modify(~ create_step_curve(x = pmin(.x$value, 100),
5656
#' event = as.numeric(.x$value < 50),
5757
#' flip_surv = TRUE,
@@ -160,8 +160,8 @@ create_step_curve <- function(x,
160160
#' response = c(1,1,0,1,1,0,0,1,1,1),
161161
#' ptid = c(1,1,2,2,3,3,3,3,3,3))
162162
#' ind_results <-
163-
#' dat %>%
164-
#' dplyr::group_by(ptid) %>%
163+
#' dat |>
164+
#' dplyr::group_by(ptid) |>
165165
#' dplyr::group_modify(~ mb_results(magnitude = .x$magnitude, response = .x$response))
166166
#'
167167
#' overall_results <-
@@ -179,17 +179,17 @@ create_step_curve <- function(x,
179179
#' data(exampleData_BAMA)
180180
#'
181181
#' data_here <-
182-
#' exampleData_BAMA %>%
182+
#' exampleData_BAMA |>
183183
#' filter(visitno == 2)
184184
#'
185185
#' group_results <-
186-
#' data_here %>%
187-
#' dplyr::group_by(group) %>%
186+
#' data_here |>
187+
#' dplyr::group_by(group) |>
188188
#' dplyr::group_modify(~ mb_results(magnitude = .x$magnitude , response = .x$response))
189189
#'
190190
#' ind_results <-
191-
#' data_here %>%
192-
#' dplyr::group_by(group, pubID) %>%
191+
#' data_here |>
192+
#' dplyr::group_by(group, pubID) |>
193193
#' dplyr::group_modify(~ mb_results(magnitude = .x$magnitude , response = .x$response))
194194
#'
195195
#' ggplot2::ggplot(data = group_results,

data-raw/cds_datasets.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ library(DataSpaceR)
55
con <- connectDS()
66

77
cvd812 <- con$getStudy('cvd812')
8-
CAVD812_mAB <- cvd812$getDataset("NAB Ig") %>%
8+
CAVD812_mAB <- cvd812$getDataset("NAB Ig") |>
99
distinct(
1010
product = mab_name_source,
1111
virus = cds_virus_name,
1212
ic50 = titer_curve_ic50,
1313
ic80 = titer_curve_ic80
14-
) %>% as.data.frame()
14+
) |> as.data.frame()
1515

1616
usethis::use_data(CAVD812_mAB, overwrite = TRUE)
1717

0 commit comments

Comments
 (0)