Skip to content

Commit 61f7400

Browse files
authored
Merge pull request #193 from olivroy/ellipsis
Drop ellipsis dependency + avoid tidyselect deprecated syntax
2 parents f594d0f + 503157d commit 61f7400

23 files changed

+112
-150
lines changed

.github/workflows/pkgdown.yaml

+31-56
Original file line numberDiff line numberDiff line change
@@ -1,74 +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
13
on:
24
push:
3-
branches: master
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
410

5-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
614

715
jobs:
816
pkgdown:
917
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 }}
1021
env:
1122
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
1225
steps:
13-
- uses: actions/checkout@v2
14-
15-
- uses: r-lib/actions/setup-r@v2
16-
with:
17-
r-version: 4.3.1
26+
- uses: actions/checkout@v4
1827

1928
- uses: r-lib/actions/setup-pandoc@v2
20-
21-
- name: Install dependencies
22-
run: |
23-
sudo apt-get install --yes libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev
24-
25-
- name: Install XQuartz
26-
if: runner.os == 'macOS'
27-
run: brew cask install xquartz
2829

29-
- name: Query dependencies
30-
run: |
31-
install.packages('remotes')
32-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
33-
shell: Rscript {0}
34-
35-
- name: Cache R packages
36-
uses: actions/cache@v1
30+
- uses: r-lib/actions/setup-r@v2
3731
with:
38-
path: ${{ env.R_LIBS_USER }}
39-
key: ubuntu-r-4.0-4-${{ hashFiles('.github/depends.Rds') }}
40-
restore-keys: ubuntu-r-4.0-4-
32+
use-public-rspm: true
4133

42-
- name: Install dependencies
43-
run: |
44-
install.packages("BiocManager")
45-
BiocManager::install("IRanges")
46-
BiocManager::install("ggtree")
47-
install.packages("remotes")
48-
remotes::install_deps(dependencies = TRUE)
49-
install.packages('pkgdown')
50-
install.packages('devtools')
51-
remotes::install_dev("dplyr")
52-
install.packages("Hmisc")
53-
shell: Rscript {0}
54-
55-
- name: Install package
56-
run: R CMD INSTALL .
34+
- uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::pkgdown, local::.
37+
needs: website
5738

58-
- name: Session Info
59-
run: |
60-
library(gggenomes)
61-
print(sessionInfo())
39+
- name: Build site
40+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
6241
shell: Rscript {0}
6342

64-
# - name: Setup upterm session
65-
# uses: lhotari/action-upterm@v1
66-
67-
- name: Configure git user
68-
run: |
69-
git config --global user.name "github-actions[bot]"
70-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
71-
72-
- name: Deploy package
73-
run: pkgdown::deploy_to_branch(new_process = FALSE, lazy=FALSE)
74-
shell: Rscript {0}
43+
- name: Deploy to GitHub pages 🚀
44+
if: github.event_name != 'pull_request'
45+
uses: JamesIves/[email protected]
46+
with:
47+
clean: false
48+
branch: gh-pages
49+
folder: docs

DESCRIPTION

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ Description: An extension of 'ggplot2' for creating complex genomic
1212
implements a layout concept inspired by 'ggraph' and introduces tracks to bring
1313
tidiness to the mess that is genomics data.
1414
License: MIT + file LICENSE
15-
URL: https://github.com/thackl/gggenomes
15+
URL: https://thackl.github.io/gggenomes/, https://github.com/thackl/gggenomes
1616
BugReports: https://github.com/thackl/gggenomes/issues
1717
Encoding: UTF-8
1818
LazyData: true
1919
RoxygenNote: 7.3.1
2020
Roxygen: list(markdown = TRUE)
2121
VignetteBuilder: knitr
2222
Depends:
23-
R (>= 3.4.2),
23+
R (>= 3.5.0),
2424
ggplot2 (>= 3.5.0),
2525
Imports:
2626
vctrs,
2727
rlang,
28-
dplyr,
28+
dplyr (>= 1.1.0),
2929
tidyr,
3030
readr (>= 2.0.0),
3131
purrr,
@@ -39,8 +39,7 @@ Imports:
3939
tidyselect,
4040
colorspace,
4141
methods,
42-
utils,
43-
ellipsis
42+
utils
4443
Suggests:
4544
testthat,
4645
ggtree,

NAMESPACE

-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ export(width)
205205
export(width0)
206206
export(write_gff3)
207207
import(dplyr)
208-
import(ellipsis)
209208
import(ggplot2)
210209
import(grid)
211210
import(rlang)

R/aaa.R

+1-14
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ ex <- function(file = NULL) {
4545
}
4646
}
4747

48-
# are there any arguments in ...
49-
has_dots <- function(env = parent.frame()) {
50-
length(ellipsis__dots(env)) > 0
51-
}
52-
5348
shared_names <- function(x, ...) {
5449
names <- c(...)
5550
names[names %in% names2(x)]
@@ -127,18 +122,10 @@ qc <- function(...) sapply(match.call()[-1], deparse)
127122
# CRAN Workaround for unexported useful tidyverse internals
128123
# https://stackoverflow.com/questions/32535773/using-un-exported-function-from-another-r-package
129124
ggplot2__ggname <- utils::getFromNamespace("ggname", "ggplot2")
130-
ggplot2__rd_aesthetics <- \(x, y) utils::getFromNamespace("rd_aesthetics", "ggplot2")(x, y) |> stringr::str_replace(stringr::fixed("link[="), "link[ggplot2:")
125+
ggplot2__rd_aesthetics <- function(x, y) utils::getFromNamespace("rd_aesthetics", "ggplot2")(x, y) |> stringr::str_replace(stringr::fixed("link[="), "link[ggplot2:")
131126
ggplot2__scales_list <- utils::getFromNamespace("scales_list", "ggplot2")
132127
ggplot2__guides_list <- utils::getFromNamespace("guides_list", "ggplot2")
133128
ggplot2__make_labels <- utils::getFromNamespace("make_labels", "ggplot2")
134-
ellipsis__dots <- utils::getFromNamespace("dots", "ellipsis")
135129
scales__force_all <- utils::getFromNamespace("force_all", "scales")
136130
purrr__as_mapper.default <- utils::getFromNamespace("as_mapper.default", "purrr")
137131

138-
# Additional fix for seamingly unused package in imports due to the workaround above
139-
# https://forum.posit.co/t/new-r-cmd-check-note-in-r-4-2-0-for-imports-field/143153/4
140-
#' @import ellipsis
141-
#' @noRd
142-
dummy <- function() {
143-
ellipsis::safe_median
144-
}

R/clusters.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ add_clusters.gggenomes <- function(x, ..., .track_id = "genes") {
3232
#' @importFrom rlang .data
3333
#' @export
3434
add_clusters.gggenomes_layout <- function(x, ..., .track_id = "genes") {
35-
if (!has_dots()) {
35+
if (...length() == 0) {
3636
warn("No clusters data provided - check your arguments")
3737
return(x)
3838
}

R/feats.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ as_feats.tbl_df <- function(x, seqs, ..., everything = TRUE) {
4545
}
4646

4747
other_vars <- if (everything) tidyselect::everything else function() NULL
48-
x <- as_tibble(select(x, vars, other_vars()))
48+
x <- as_tibble(select(x, dplyr::all_of(vars), other_vars()))
4949
# TODO: mutate_at - if at all
5050
x %<>% mutate_if(is.factor, as.character)
5151

@@ -90,7 +90,7 @@ layout_feats <- function(
9090

9191
# project feats onto new layout and clean up aux vars (.seq)
9292
x <- project_feats(x) %>%
93-
select(.data$y, .data$x, .data$xend, .data$bin_id, everything(), -starts_with(".seq"))
93+
select("y", "x", "xend", "bin_id", everything(), -starts_with(".seq"))
9494
x
9595
}
9696

@@ -128,7 +128,7 @@ add_feats.gggenomes <- function(x, ...) {
128128

129129
#' @export
130130
add_feats.gggenomes_layout <- function(x, ...) {
131-
if (!has_dots()) {
131+
if (...length() == 0) {
132132
return(x)
133133
}
134134
dot_exprs <- enexprs(...) # defuse before list(...)
@@ -145,8 +145,8 @@ add_feat_layout_scaffold <- function(x, seqs) {
145145
scaffold <- seqs %>%
146146
ungroup() %>%
147147
select(
148-
.data$seq_id, .data$bin_id, .data$y,
149-
.seq_strand = .data$strand, .seq_x = .data$x, .seq_start = .data$start, .seq_end = .data$end
148+
"seq_id", "bin_id", "y",
149+
.seq_strand = "strand", .seq_x = "x", .seq_start = "start", .seq_end = "end"
150150
)
151151

152152
inner_join(x, scaffold, by = shared_names(x, "seq_id", "bin_id"))

R/flip.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ flip.gggenomes <- function(x, ..., .bin_track = seqs) {
6464
}
6565
#' @export
6666
flip.gggenomes_layout <- function(x, ..., .bin_track = seqs) {
67-
if (!has_dots()) {
67+
if (...length() == 0) {
6868
return(x)
6969
}
7070
flip_impl(x, bins = c(...), bin_track = {{ .bin_track }})
@@ -84,7 +84,7 @@ flip_seqs.gggenomes <- function(x, ..., .bins = everything(), .seq_track = seqs,
8484
}
8585
#' @export
8686
flip_seqs.gggenomes_layout <- function(x, ..., .bins = everything(), .seq_track = seqs, .bin_track = seqs) {
87-
if (!has_dots()) {
87+
if (...length() == 0) {
8888
return(x)
8989
}
9090
flip_impl(x, bins = {{ .bins }}, seqs = c(...), bin_track = {{ .bin_track }}, seq_track = {{ .seq_track }})
@@ -111,8 +111,8 @@ sync.gggenomes_layout <- function(x, link_track = 1, min_support = 0) {
111111
s0 <- ungroup(pull_seqs(x))
112112

113113
f0 <- l0 |>
114-
dplyr::left_join(select(s0, .data$seq_id, seq_strand = .data$strand), by = "seq_id") |>
115-
dplyr::left_join(select(s0, seq_id2 = .data$seq_id, seq_strand2 = .data$strand), by = "seq_id2") |>
114+
dplyr::left_join(select(s0, "seq_id", seq_strand = "strand"), by = "seq_id") |>
115+
dplyr::left_join(select(s0, seq_id2 = "seq_id", seq_strand2 = "strand"), by = "seq_id2") |>
116116
dplyr::mutate(
117117
bin_id = ifelse(.data$y < .data$yend, .data$bin_id, .data$bin_id2), # chose the lower bin id
118118
bin_id2 = ifelse(.data$y < .data$yend, .data$bin_id2, .data$bin_id), # chose the lower bin id
@@ -129,7 +129,7 @@ sync.gggenomes_layout <- function(x, link_track = 1, min_support = 0) {
129129

130130
bins_to_flip <- f0 |>
131131
dplyr::filter(.data$needs_flip) |>
132-
dplyr::pull(.data$bin_id)
132+
dplyr::pull("bin_id")
133133

134134
if (!length(bins_to_flip)) {
135135
inform(str_glue(

R/focus.R

+9-9
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ locate_impl <- function(
215215
# => mirror links to seq1 to ensure seq2 links are accounted for
216216
if (track_type(x, {{ .track_id }}) == "links") {
217217
targets2 <- dplyr::rename(targets,
218-
seq_id = .data$seq_id2, seq_id2 = .data$seq_id,
219-
start = .data$start2, start2 = .data$start, end = .data$end2, end2 = .data$end
218+
seq_id = "seq_id2", seq_id2 = "seq_id",
219+
start = "start2", start2 = "start", end = "end2", end2 = "end"
220220
)
221221
targets <- bind_rows(targets, targets2)
222222
}
@@ -250,9 +250,9 @@ focus_feats <- function(track, seqs, bin_id) {
250250
add_feat_focus_scaffold <- function(track, seqs) {
251251
scaffold <- seqs %>%
252252
ungroup() %>%
253-
dplyr::select(
254-
.data$seq_id, .data$bin_id, .data$locus_id, .data$y,
255-
.seq_strand = .data$strand, .seq_x = .data$x, .seq_start = .data$start, .seq_end = .data$end
253+
select(
254+
"seq_id", "bin_id", "locus_id", "y",
255+
.seq_strand = "strand", .seq_x = "x", .seq_start = "start", .seq_end = "end"
256256
)
257257

258258
inner_join(track, scaffold, by = shared_names(track, "seq_id", "bin_id", "locus_id"))
@@ -278,14 +278,14 @@ add_link_focus_scaffold <- function(track, seqs) {
278278
scaffold <- seqs %>%
279279
ungroup() %>%
280280
select(
281-
seq_id = .data$seq_id, bin_id = .data$bin_id, locus_id = .data$locus_id, y = .data$y, .seq_strand = .data$strand, .seq_x = .data$x,
282-
.seq_start = .data$start, .seq_end = .data$end
281+
seq_id = "seq_id", bin_id = "bin_id", locus_id = "locus_id", y = "y", .seq_strand = "strand", .seq_x = "x",
282+
.seq_start = "start", .seq_end = "end"
283283
)
284284
scaffold2 <- seqs %>%
285285
ungroup() %>%
286286
select(
287-
seq_id2 = .data$seq_id, bin_id2 = .data$bin_id, locus_id2 = .data$locus_id, yend = .data$y, .seq_strand2 = .data$strand, .seq_x2 = .data$x,
288-
.seq_start2 = .data$start, .seq_end2 = .data$end
287+
seq_id2 = "seq_id", bin_id2 = "bin_id", locus_id2 = "locus_id", yend = "y", .seq_strand2 = "strand", .seq_x2 = "x",
288+
.seq_start2 = "start", .seq_end2 = "end"
289289
)
290290

291291
track <- inner_join(track, scaffold, by = shared_names(track, "seq_id", "bin_id", "locus_id"))

R/geom_gene.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ makeContent.genetree <- function(x) {
238238
coord_flipped <- FALSE
239239
if (names(data)[1] == "x") {
240240
coord_flipped <- TRUE
241-
data <- rename(data, y = .data$x, x = .data$y, xend = .data$yend)
241+
data <- rename(data, y = "x", x = "y", xend = "yend")
242242
}
243243

244244
s <- x$sizes

R/gggenomes.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ infer_seqs_from_feats <- function(
263263
.start = {{ infer_start }},
264264
.end = {{ infer_end }}
265265
) %>%
266-
dplyr::rename(start = .data$.start, end = .data$.end) # this is necessary, so {{ infer_end }} does
266+
dplyr::rename(start = ".start", end = ".end") # this is necessary, so {{ infer_end }} does
267267
# not already use the "start" from {{ infer_start }}
268268

269269
dplyr::ungroup(seqs)
@@ -289,7 +289,7 @@ infer_seqs_from_links <- function(
289289
.start = {{ infer_start }},
290290
.end = {{ infer_end }}
291291
) %>%
292-
dplyr::rename(start = .data$.start, end = .data$.end)
292+
dplyr::rename(start = ".start", end = ".end")
293293

294294
dplyr::ungroup(seqs)
295295
}

0 commit comments

Comments
 (0)