Skip to content

Commit d82a1bc

Browse files
committed
Merge branch 'develop' into lemireg-add_quartiles-pairwise_test_cont
2 parents 14dbece + 12a2d0d commit d82a1bc

23 files changed

+704
-229
lines changed

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ CONDUCT.md
88
CONTRIBUTING.md
99
^\.github$
1010
data-raw/
11+
^_pkgdown\.yml$
12+
^docs$
13+
^pkgdown$

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,22 @@ jobs:
5151
fancyhdr colortbl soul setspace relsize makecell threeparttable
5252
threeparttablex environ trimspaces
5353
54-
- uses: r-lib/actions/setup-r@v2
54+
- name: Setup recent R
55+
uses: r-lib/actions/setup-r@v2
56+
if: ${{ matrix.config.r != '4.0.4' }}
5557
with:
5658
r-version: ${{ matrix.config.r }}
5759
http-user-agent: ${{ matrix.config.http-user-agent }}
5860
use-public-rspm: true
5961

60-
- name: Install statsrv packages
62+
- name: Setup R 4.0.4
63+
uses: r-lib/actions/setup-r@v2
6164
if: ${{ matrix.config.r == '4.0.4' }}
62-
run: |
63-
sudo apt install -y libx11-dev make libgit2-dev libssh2-1-dev libssl-dev zlib1g-dev libicu-dev libpng-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libxml2-dev libcurl4-openssl-dev
64-
R -q -e 'utils::install.packages("remotes")'
65-
R -q -e 'remotes::install_version("htmlTable", "2.4.1")'
66-
R -q -e 'remotes::install_version("scales", "1.3.0")'
67-
R -q -e 'remotes::install_version("Hmisc", "4.5-0")'
68-
R -q -e 'remotes::install_version("svglite", "2.1.3")'
69-
R -q -e 'remotes::install_github("FredHutch/VISCfunctions", dependencies = TRUE)'
70-
R -q -e 'utils::install.packages("rcmdcheck")'
65+
with:
66+
r-version: ${{ matrix.config.r }}
67+
cran: 'https://packagemanager.posit.co/cran/__linux__/noble/2024-04-19'
7168

7269
- uses: r-lib/actions/setup-r-dependencies@v2
73-
if: ${{ matrix.config.r != '4.0.4' }}
7470
with:
7571
extra-packages: any::rcmdcheck
7672
needs: check

.github/workflows/pkgdown.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
14+
15+
jobs:
16+
pkgdown:
17+
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: r-lib/actions/setup-pandoc@v2
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
use-public-rspm: true
33+
34+
- uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::pkgdown, local::.
37+
needs: website
38+
39+
- name: Build site
40+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+
shell: Rscript {0}
42+
43+
- name: Deploy to GitHub pages 🚀
44+
if: github.event_name != 'pull_request'
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
46+
with:
47+
clean: false
48+
branch: gh-pages
49+
folder: docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ doc
2020
Meta
2121
/doc/
2222
/Meta/
23+
docs

DESCRIPTION

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
1-
Package: VISCfunctions
21
Type: Package
2+
Package: VISCfunctions
33
Title: VISC STP/SRA functions
4-
Version: 1.3.0
5-
Authors@R: c(person("Bryan", "Mayer", ,"bmayer@fredhutch.org", "aut"),
6-
person("Monica", "Gerber", ,"mgerber@fredhutch.org", "aut"),
7-
person("Celia", "Mahoney", ,"cmahoney@fredhutch.org", "aut"),
8-
person("Ellis", "Hughes", ,"ehhughes@fredhutch.org", "aut"),
9-
person("Heather", "Bouzek", ,"hbouzek@fredhutch.org", "aut"),
10-
person("Jimmy", "Fulp", ,"wfulp@fredhutch.org", c("aut", "cre"))
11-
)
12-
Description: Statistical, data processing, and annotation functions for VISC.
4+
Version: 1.3.0.9000
5+
Authors@R: c(
6+
person("Bryan", "Mayer", , "bmayer@fredhutch.org", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2258-5276")),
7+
person("Dave", "Slager", , "dslager@fredhutch.org", role = "aut", comment = c(ORCID = "0000-0003-2525-2039")),
8+
person("Kellie", "MacPhee", , "kmacphee@fredhutch.org", role = "aut", comment = c(ORCID = "0009-0008-0993-4009")),
9+
person("Gabrielle", "Lemire", , "glemire@fredhutch.org", role = "aut"),
10+
person("Claudio", "Yurdadon", , "cyurdado@fredhutch.org", role = "aut", comment = c(ORCID = "0000-0002-4928-2737")),
11+
person("Monica", "Gerber", , , role = "aut"),
12+
person("Celia", "Mahoney", , , role = "aut"),
13+
person("Ellis", "Hughes", , , role = "aut", comment = c(ORCID = "0000-0003-0637-4436")),
14+
person("Heather", "Bouzek", , , role = "aut"),
15+
person("Jimmy", "Fulp", , , role = "aut")
16+
)
17+
Description:
18+
Statistical, data processing, and annotation functions for VISC.
1319
License: MIT + file LICENSE
14-
Depends: R (>= 2.10)
20+
Depends:
21+
R (>= 3.5)
1522
Imports:
1623
binom,
17-
coin (>= 1.3-1),
24+
coin,
1825
Exact,
1926
kableExtra,
2027
knitr,
2128
lifecycle,
22-
purrr,
2329
sessioninfo,
2430
survival,
2531
withr
2632
Suggests:
27-
ggplot2,
2833
dplyr,
29-
tidyr,
34+
ggplot2,
3035
pracma,
31-
rmarkdown,
3236
testthat,
33-
stringr,
34-
tibble
37+
tidyr
3538
VignetteBuilder:
3639
knitr
3740
Encoding: UTF-8
3841
LazyData: true
39-
RoxygenNote: 7.3.2
4042
Roxygen: list(markdown = TRUE)
43+
RoxygenNote: 7.3.3
44+
URL: https://fredhutch.github.io/VISCfunctions/

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# VISCfunctions (development version)
2+
3+
* Maintenance of package and CI (#114)
4+
* Add B cell example dataset from G001 flow and sequencing file (#108)
5+
16
# VISCfunctions 1.3.0
27

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

R/data.R

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,34 @@
7474
#' }
7575
#' @source \url{https://dataspace.cavd.org}
7676
"CAVD812_mAB"
77+
78+
#' @title Example B-cell flow-and-summary file derived from G001
79+
#' @description Example B-cell flow-and-summary file derived from G001
80+
#' @format A data frame with 3995 rows and 22 variables:
81+
#' \describe{
82+
#' \item{\code{pubid}}{character COLUMN_DESCRIPTION}
83+
#' \item{\code{group}}{integer COLUMN_DESCRIPTION}
84+
#' \item{\code{treatment}}{character COLUMN_DESCRIPTION}
85+
#' \item{\code{dose}}{double COLUMN_DESCRIPTION}
86+
#' \item{\code{dose_unit}}{character COLUMN_DESCRIPTION}
87+
#' \item{\code{visitno}}{character COLUMN_DESCRIPTION}
88+
#' \item{\code{visit}}{integer COLUMN_DESCRIPTION}
89+
#' \item{\code{visit_units}}{character COLUMN_DESCRIPTION}
90+
#' \item{\code{sample_type}}{character COLUMN_DESCRIPTION}
91+
#' \item{\code{probeset}}{character COLUMN_DESCRIPTION}
92+
#' \item{\code{source_assay}}{character COLUMN_DESCRIPTION}
93+
#' \item{\code{endpoint}}{character COLUMN_DESCRIPTION}
94+
#' \item{\code{endpoint_value}}{double COLUMN_DESCRIPTION}
95+
#' \item{\code{endpoint_value_type}}{character COLUMN_DESCRIPTION}
96+
#' \item{\code{endpoint_value_imputed}}{character COLUMN_DESCRIPTION}
97+
#' \item{\code{bcell_population}}{character COLUMN_DESCRIPTION}
98+
#' \item{\code{percent_denominator}}{character COLUMN_DESCRIPTION}
99+
#' \item{\code{igx_type}}{character COLUMN_DESCRIPTION}
100+
#' \item{\code{antigen_specificity}}{character COLUMN_DESCRIPTION}
101+
#' \item{\code{epitope_specificity}}{character COLUMN_DESCRIPTION}
102+
#' \item{\code{bnab_class}}{character COLUMN_DESCRIPTION}
103+
#' \item{\code{source_file}}{character COLUMN_DESCRIPTION}
104+
#'}
105+
#' @details Example B-cell flow-and-summary file derived from G001
106+
#' @source \url{https://github.com/SchiefLab/G001/raw/main/data/figures/flow_summary/flow_and_sequences.csv.gz}
107+
"G001_Bcell_flow_seq_PBMC"

R/pairwise_comparisons.R

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,32 @@
8585
#' ## Group Comparison
8686
#'group_testing_tibble <- exampleData_BAMA %>%
8787
#' group_by(antigen, visitno) %>%
88-
#' summarise(pairwise_test_cont(x = magnitude,
89-
#' group = group,
90-
#' paired = FALSE,
91-
#' method = 'wilcox',
92-
#' alternative = "less",
93-
#' sorted_group = c(1,2),
94-
#' digits = 3,
95-
#' num_needed_for_test = 3,
96-
#' verbose = TRUE),
97-
#' .groups = "keep")
88+
#' reframe(pairwise_test_cont(x = magnitude,
89+
#' group = group,
90+
#' paired = FALSE,
91+
#' method = 'wilcox',
92+
#' alternative = "less",
93+
#' sorted_group = c(1,2),
94+
#' digits = 3,
95+
#' num_needed_for_test = 3,
96+
#' verbose = TRUE))
9897
#'
9998
#'
10099
#' ## Timepoint Comparison
101100
#'timepoint_testing_dt <- exampleData_BAMA %>%
102101
#' group_by(antigen, group) %>%
103-
#' summarise(pairwise_test_cont(x = magnitude,
104-
#' group = visitno,
105-
#' paired = TRUE,
106-
#' id = pubID,
107-
#' method = 'wilcox',
108-
#' sorted_group = c(0,1,2),
109-
#' alternative = 'less',
110-
#' num_needed_for_test = 3,
111-
#' digits = 3,
112-
#' trailing_zeros = TRUE,
113-
#' sep_val = ' vs. ',
114-
#' verbose = TRUE),
115-
#' .groups = "keep")
102+
#' reframe(pairwise_test_cont(x = magnitude,
103+
#' group = visitno,
104+
#' paired = TRUE,
105+
#' id = pubID,
106+
#' method = 'wilcox',
107+
#' sorted_group = c(0,1,2),
108+
#' alternative = 'less',
109+
#' num_needed_for_test = 3,
110+
#' digits = 3,
111+
#' trailing_zeros = TRUE,
112+
#' sep_val = ' vs. ',
113+
#' verbose = TRUE))
116114
#'
117115
#'
118116
#' # ICS Assay Data Example
@@ -122,35 +120,33 @@
122120
#' # using dplyr
123121
#'exampleData_ICS %>%
124122
#'group_by(Stim, Parent, Population, Visit) %>%
125-
#'summarise(pairwise_test_cont(x = PercentCellNet,
126-
#' group = Group,
127-
#' paired = FALSE,
128-
#' method = 'wilcox',
129-
#' alternative = 'less',
130-
#' sorted_group = c(1,2,3,4),
131-
#' num_needed_for_test = 3,
132-
#' digits = 4,
133-
#' trailing_zeros = TRUE,
134-
#' sep_val = ' vs. ',
135-
#' verbose = TRUE),
136-
#' .groups = "keep")
123+
#'reframe(pairwise_test_cont(x = PercentCellNet,
124+
#' group = Group,
125+
#' paired = FALSE,
126+
#' method = 'wilcox',
127+
#' alternative = 'less',
128+
#' sorted_group = c(1,2,3,4),
129+
#' num_needed_for_test = 3,
130+
#' digits = 4,
131+
#' trailing_zeros = TRUE,
132+
#' sep_val = ' vs. ',
133+
#' verbose = TRUE))
137134
#'
138135
#' # Timepoint Comparison
139136
#'timepoint_testing_dt <- exampleData_ICS %>%
140137
#' group_by(Stim, Parent, Population, Group) %>%
141-
#' summarise(pairwise_test_cont(x = PercentCellNet,
142-
#' group = Visit,
143-
#' paired = TRUE,
144-
#' id = pubID,
145-
#' method = 'wilcox',
146-
#' sorted_group = c(0,1,2),
147-
#' alternative = 'less',
148-
#' num_needed_for_test = 3,
149-
#' digits = 4,
150-
#' trailing_zeros = TRUE,
151-
#' sep_val = ' vs. ',
152-
#' verbose = TRUE),
153-
#' .groups = "keep")
138+
#' reframe(pairwise_test_cont(x = PercentCellNet,
139+
#' group = Visit,
140+
#' paired = TRUE,
141+
#' id = pubID,
142+
#' method = 'wilcox',
143+
#' sorted_group = c(0,1,2),
144+
#' alternative = 'less',
145+
#' num_needed_for_test = 3,
146+
#' digits = 4,
147+
#' trailing_zeros = TRUE,
148+
#' sep_val = ' vs. ',
149+
#' verbose = TRUE))
154150
#'
155151
#'
156152
#'@export
@@ -791,7 +787,7 @@ pairwise_test_bin <- function(x,
791787
#' cor_test_pairs(x = magnitude, pair = antigen, id = pubID,
792788
#' method = 'spearman', n_distinct_value = 3, digits = 1, verbose = TRUE),
793789
#' .groups = 'drop'
794-
#' )
790+
#' )
795791
#'
796792
#' @export
797793

R/pretty_output_functions.R

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,14 @@
4646
#'
4747
#' descriptive_stats_by_group <- exampleData_BAMA %>%
4848
#' group_by(visitno,antigen) %>%
49-
#' summarise(
49+
#' 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]),
5252
#' Group1_mean = mean(magnitude[group == 1]), Group2_mean = mean(magnitude[group == 2]),
5353
#' Group1_sd = sd(magnitude[group == 1]), Group2_sd = sd(magnitude[group == 2]),
5454
#' Group1_median = median(magnitude[group == 1]), Group2_median = median(magnitude[group == 2]),
5555
#' Group1_min = min(magnitude[group == 1]), Group2_min = min(magnitude[group == 2]),
56-
#' Group1_max = max(magnitude[group == 1]), Group2_max = max(magnitude[group == 2]),
57-
#' .groups = 'drop'
56+
#' Group1_max = max(magnitude[group == 1]), Group2_max = max(magnitude[group == 2])
5857
#' )
5958
#'
6059
#' paste_tbl_grp(data = descriptive_stats_by_group, vars_to_paste = 'all', first_name = 'Group1',
@@ -74,10 +73,9 @@
7473
#'exampleData_BAMA %>%
7574
#' mutate(group = paste0("Group", group)) %>%
7675
#' group_by(group, visitno, antigen) %>%
77-
#' summarise(N = n(), mean = mean(magnitude), sd = sd(magnitude),
78-
#' median = median(magnitude), min = min(magnitude),
79-
#' max = max(magnitude), q95_fun = quantile(magnitude, 0.95),
80-
#' .groups = 'drop') %>%
76+
#' reframe(N = n(), mean = mean(magnitude), sd = sd(magnitude),
77+
#' median = median(magnitude), min = min(magnitude),
78+
#' max = max(magnitude), q95_fun = quantile(magnitude, 0.95)) %>%
8179
#' pivot_longer(-(group:antigen)) %>% # these three chains create a wide dataset
8280
#' unite(temp, group, name) %>%
8381
#' pivot_wider(names_from = temp, values_from = value) %>%

0 commit comments

Comments
 (0)