Skip to content

Commit 98c4064

Browse files
Fix BiocCheck errors and notes for examples and vignette
- Replace \dontrun with runnable examples for read_counts(), read_mod_annotations(), and compute_odds_ratios() using new small example data files in inst/extdata/ecoli/ - Convert \dontrun to \donttest for fetch_modomics_mods() (needs network) - Guard \donttest examples for plot_arc_diagram() and structure_to_png() with requireNamespace() checks for suggested packages - Add chunk label to first vignette code chunk - Refactor suppressWarnings(as.numeric()) in plot-chord.R to use grepl - Wrap long example file paths to stay under 80 characters Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32cf16b commit 98c4064

23 files changed

+95
-62
lines changed

DESCRIPTION

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ Description: Analyze direct tRNA sequencing data. Provides differential
1515
expression, modification, and tools for visualization.
1616
License: MIT + file LICENSE
1717
URL: https://rnabioco.github.io/clover, https://github.com/rnabioco/clover
18+
BugReports: https://github.com/rnabioco/clover/issues
1819
Depends:
19-
R (>= 4.3.0)
20+
R (>= 4.5.0)
2021
Imports:
2122
Biostrings,
2223
cli,
@@ -55,11 +56,11 @@ Suggests:
5556
testthat (>= 3.0.0),
5657
tidygraph,
5758
withr
58-
LinkingTo:
59+
LinkingTo:
5960
cpp11
60-
VignetteBuilder:
61+
VignetteBuilder:
6162
knitr
62-
bioCViews: RNASeq, Visualization
63+
biocViews: RNASeq, Visualization
6364
Config/Needs/dev: devtools, roxygen2, pkgdown
6465
Config/Needs/website: rnabioco/rbitemplate
6566
Config/testthat/edition: 3

R/clover-se.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ read_fasta <- function(fa) {
134134
#' @export
135135
#'
136136
#' @examples
137-
#' \dontrun{
138-
#' read_mod_annotations("modifications.tsv")
139-
#' }
137+
#' path <- clover_example("ecoli/mod_annotations.tsv")
138+
#' read_mod_annotations(path)
140139
read_mod_annotations <- function(mods) {
141140
readr::read_tsv(mods, show_col_types = FALSE)
142141
}

R/modomics.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ load_cached_sequences <- function(organism) {
181181
#' @export
182182
#'
183183
#' @examples
184-
#' \dontrun{
184+
#' \donttest{
185185
#' fa <- clover_example("ecoli/validated.fa.gz")
186186
#' mods <- fetch_modomics_mods(fa, "Escherichia coli")
187187
#' mods

R/odds-ratios.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,8 @@ compute_ror <- function(
317317
#' @export
318318
#'
319319
#' @examples
320-
#' \dontrun{
321-
#' compute_odds_ratios("sample.mod_calls.tsv.gz")
322-
#' }
320+
#' path <- clover_example("ecoli/mod_calls.tsv.gz")
321+
#' compute_odds_ratios(path)
323322
compute_odds_ratios <- function(mod_calls_path, refs = NULL, min_reads = 10) {
324323
mc <- readr::read_tsv(mod_calls_path, show_col_types = FALSE) |>
325324
dplyr::filter(.data$within_alignment == TRUE)

R/plot-chord.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
#'
4141
#' @examples
4242
#' \donttest{
43-
#' path <- clover_example(
44-
#' "ecoli/summary/tables/wt-15-ctl-01/wt-15-ctl-01.odds_ratios_filtered.tsv.gz"
43+
#' or_file <- paste0(
44+
#' "ecoli/summary/tables/wt-15-ctl-01/",
45+
#' "wt-15-ctl-01.odds_ratios_filtered.tsv.gz"
4546
#' )
47+
#' path <- clover_example(or_file)
4648
#' or_data <- read_odds_ratios(path)
4749
#' or_data <- dplyr::filter(or_data, ref == "host-tRNA-Glu-TTC-1-1")
4850
#' plot_chord_or(or_data)
@@ -353,10 +355,12 @@ setup_chord_sectors <- function(chord_df, sprinzl_coords = NULL) {
353355
} else {
354356
all_positions <- unique(c(chord_df$from, chord_df$to))
355357
# Sort positions numerically where possible
356-
sector_order <- all_positions[order(
357-
suppressWarnings(as.numeric(all_positions)),
358-
all_positions
359-
)]
358+
numeric_pos <- ifelse(
359+
grepl("^-?[0-9.]+$", all_positions),
360+
as.numeric(all_positions),
361+
NA_real_
362+
)
363+
sector_order <- all_positions[order(numeric_pos, all_positions)]
360364
grid_col <- rep("grey70", length(sector_order))
361365
names(grid_col) <- sector_order
362366
regions <- NULL

R/plot-network.R

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ build_or_network <- function(data, value_col = "ror", min_weight = 0) {
8686
#'
8787
#' @examples
8888
#' \donttest{
89-
#' df <- tibble::tibble(
90-
#' pos1 = c("20", "34", "20"),
91-
#' pos2 = c("34", "58", "58"),
92-
#' ror = c(1.5, -0.8, 0.3)
93-
#' )
94-
#' graph <- build_or_network(df)
95-
#' plot_arc_diagram(graph)
89+
#' if (requireNamespace("ggraph", quietly = TRUE)) {
90+
#' df <- tibble::tibble(
91+
#' pos1 = c("20", "34", "20"),
92+
#' pos2 = c("34", "58", "58"),
93+
#' ror = c(1.5, -0.8, 0.3)
94+
#' )
95+
#' graph <- build_or_network(df)
96+
#' plot_arc_diagram(graph)
97+
#' }
9698
#' }
9799
plot_arc_diagram <- function(
98100
graph,

R/plot-structure.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ plot_tRNA_structure <- function(
233233
#'
234234
#' @examples
235235
#' \donttest{
236-
#' svg <- plot_tRNA_structure("tRNA-Glu-TTC", "Escherichia coli")
237-
#' structure_to_png(svg)
236+
#' if (requireNamespace("rsvg", quietly = TRUE)) {
237+
#' svg <- plot_tRNA_structure("tRNA-Glu-TTC", "Escherichia coli")
238+
#' structure_to_png(svg)
239+
#' }
238240
#' }
239241
structure_to_png <- function(
240242
svg_path,

R/read-bcerror.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#' @export
1010
#'
1111
#' @examples
12-
#' \dontrun{
13-
#' read_counts("sample1.counts.tsv.gz")
14-
#' }
12+
#' read_counts(clover_example("ecoli/counts.tsv"))
1513
read_counts <- function(path) {
1614
readr::read_tsv(path, show_col_types = FALSE)
1715
}

R/read-charging.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,17 @@ read_charging_multi <- function(paths) {
104104
#' @export
105105
#'
106106
#' @examples
107+
#' or_file1 <- paste0(
108+
#' "ecoli/summary/tables/wt-15-ctl-01/",
109+
#' "wt-15-ctl-01.odds_ratios_filtered.tsv.gz"
110+
#' )
111+
#' or_file2 <- paste0(
112+
#' "ecoli/summary/tables/wt-15-ctl-02/",
113+
#' "wt-15-ctl-02.odds_ratios_filtered.tsv.gz"
114+
#' )
107115
#' paths <- c(
108-
#' "wt-15-ctl-01" = clover_example(
109-
#' "ecoli/summary/tables/wt-15-ctl-01/wt-15-ctl-01.odds_ratios_filtered.tsv.gz"
110-
#' ),
111-
#' "wt-15-ctl-02" = clover_example(
112-
#' "ecoli/summary/tables/wt-15-ctl-02/wt-15-ctl-02.odds_ratios_filtered.tsv.gz"
113-
#' )
116+
#' "wt-15-ctl-01" = clover_example(or_file1),
117+
#' "wt-15-ctl-02" = clover_example(or_file2)
114118
#' )
115119
#' read_odds_ratios_multi(paths)
116120
read_odds_ratios_multi <- function(paths) {

inst/extdata/ecoli/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ demonstrate the data-loading workflow.
5252
| host-tRNA-Arg-CCT-1-1 | Least abundant |
5353
| host-tRNA-Ser-CGA-1-1 | Least abundant |
5454

55+
### Minimal example files
56+
57+
Small example files used in roxygen `@examples`:
58+
59+
- `counts.tsv` -- 3-row counts file for `read_counts()`
60+
- `mod_annotations.tsv` -- 3-row modification annotations for `read_mod_annotations()`
61+
- `mod_calls.tsv.gz` -- synthetic mod calls (15 reads, 1 tRNA) for `compute_odds_ratios()`
62+
5563
### Other files
5664

5765
- `config.yaml` -- pipeline configuration file (used by `create_clover()`)

0 commit comments

Comments
 (0)