Skip to content

Commit 7bd7950

Browse files
fix CRAN comments
1 parent 5903d8d commit 7bd7950

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+71
-376
lines changed

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 0.3.6
2-
Date: 2023-04-04 01:17:39 UTC
3-
SHA: 878d2d6d9ed9edc4f9be9305a85f4d153d048f04
1+
Version: 0.3.8
2+
Date: 2025-02-07 23:49:53 UTC
3+
SHA: 5903d8d485afb70d21fff93a42af56246a4e2b84

DESCRIPTION

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
11
Package: metacoder
22
Title: Tools for Parsing, Manipulating, and Graphing Taxonomic Abundance Data
33
Version: 0.3.8
4-
Authors@R: c(person("Zachary", "Foster", email =
5-
"zacharyfoster1989@gmail.com", role = c("aut", "cre")),
6-
person("Niklaus", "Grunwald", email =
7-
"grunwaln@science.oregonstate.edu", role = c("ths")),
8-
person("Rob", "Gilmore", email = "rgilmore@ummc.edu",
9-
role = "ctb"))
4+
Authors@R:
5+
c(person(given = "Zachary",
6+
family = "Foster",
7+
role = c("aut", "cre"),
8+
email = "zacharyfoster1989@gmail.com"),
9+
person(given = "Niklaus",
10+
family = "Grunwald",
11+
role = c("ths"),
12+
email = "grunwaln@science.oregonstate.edu"),
13+
person(given = "Kamil",
14+
family = "Slowikowski",
15+
role = c("ctb")),
16+
person(given = "Scott",
17+
family = "Chamberlain",
18+
role = c("ctb")),
19+
person(given = "Rob",
20+
family = "Gilmore",
21+
role = "ctb"))
1022
Maintainer: Zachary Foster <zacharyfoster1989@gmail.com>
11-
Description: A set of tools for parsing, manipulating, and graphing data
12-
classified by a hierarchy (e.g. a taxonomy).
23+
Description: 'Metacoder' is a package for reading, plotting, and manipulating large
24+
taxonomic data sets, like those generated from modern high-throughput
25+
sequencing, like metabarcoding (i.e. amplification metagenomics, 16S
26+
metagenomics, etc). It provides a tree-based visualization called "heat
27+
trees" used to depict statistics for every taxon in a taxonomy using
28+
color and size. It also provides various functions to do common tasks in
29+
microbiome bioinformatics on data in the 'taxmap' format defined by the
30+
'taxa' package. The 'metacoder' package is described in the publication
31+
by Foster et al. (2027) <doi:10.1371/journal.pcbi.1005404>.
1332
Depends:
1433
R (>= 3.0.2)
1534
License: GPL-2 | GPL-3

R/as_phyloseq.R

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,14 @@
3030
#' }
3131
#'
3232
#' @examples
33-
#' \dontrun{
34-
#' # Install phyloseq to get example data
35-
#' # if (!require("BiocManager", quietly = TRUE))
36-
#' # install.packages("BiocManager")
37-
#' #
38-
#' # BiocManager::install("phyloseq")
39-
#'
33+
#' \donttest{
4034
#' # Parse example dataset
4135
#' library(phyloseq)
4236
#' data(GlobalPatterns)
4337
#' x <- parse_phyloseq(GlobalPatterns)
4438
#'
4539
#' # Convert back to a phylseq object
4640
#' as_phyloseq(x)
47-
#'
4841
#' }
4942
#' @export
5043
as_phyloseq <- function(obj,

R/calculations--differential_abundance.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#' @family calculations
4141
#'
4242
#' @examples
43-
#' \dontrun{
43+
#' \donttest{
4444
#' # Parse data for plotting
4545
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
4646
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),

R/calculations.R

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#' @export
1414
#'
1515
#' @examples
16-
#' \dontrun{
1716
#' # Parse data for examples
1817
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
1918
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -39,8 +38,6 @@
3938
#' # Rename output columns
4039
#' calc_group_mean(x, "tax_data", groups = hmp_samples$sex,
4140
#' out_names = c("Women", "Men"))
42-
#'
43-
#' }
4441
calc_group_mean <- function(obj, data, groups, cols = NULL,
4542
other_cols = FALSE, out_names = NULL, dataset = NULL) {
4643

@@ -75,7 +72,6 @@ calc_group_mean <- function(obj, data, groups, cols = NULL,
7572
#' @export
7673
#'
7774
#' @examples
78-
#' \dontrun{
7975
#' # Parse data for examples
8076
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
8177
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -101,8 +97,6 @@ calc_group_mean <- function(obj, data, groups, cols = NULL,
10197
#' # Rename output columns
10298
#' calc_group_rsd(x, "tax_data", groups = hmp_samples$sex,
10399
#' out_names = c("Women", "Men"))
104-
#'
105-
#' }
106100
calc_group_rsd <- function(obj, data, groups, cols = NULL,
107101
other_cols = FALSE, out_names = NULL, dataset = NULL) {
108102
# Check for use of "dataset"
@@ -135,7 +129,6 @@ calc_group_rsd <- function(obj, data, groups, cols = NULL,
135129
#' @export
136130
#'
137131
#' @examples
138-
#' \dontrun{
139132
#' # Parse data for examples
140133
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
141134
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -161,10 +154,8 @@ calc_group_rsd <- function(obj, data, groups, cols = NULL,
161154
#' # Rename output columns
162155
#' calc_group_median(x, "tax_data", groups = hmp_samples$sex,
163156
#' out_names = c("Women", "Men"))
164-
#'
165-
#' }
166157
calc_group_median <- function(obj, data, groups, cols = NULL,
167-
other_cols = FALSE, out_names = NULL, dataset = NULL) {
158+
other_cols = FALSE, out_names = NULL, dataset = NULL) {
168159

169160
# Check for use of "dataset"
170161
if (! is.null(dataset)) {
@@ -198,7 +189,6 @@ calc_group_median <- function(obj, data, groups, cols = NULL,
198189
#' @export
199190
#'
200191
#' @examples
201-
#' \dontrun{
202192
#' # Parse data for examples
203193
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
204194
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -234,8 +224,6 @@ calc_group_median <- function(obj, data, groups, cols = NULL,
234224
#' # Rename output columns
235225
#' calc_group_stat(x, "tax_data", mean, groups = hmp_samples$sex,
236226
#' out_names = c("Women", "Men"))
237-
#'
238-
#' }
239227
calc_group_stat <- function(obj, data, func, groups = NULL, cols = NULL,
240228
other_cols = FALSE, out_names = NULL, dataset = NULL) {
241229

@@ -274,7 +262,6 @@ calc_group_stat <- function(obj, data, func, groups = NULL, cols = NULL,
274262
#' @export
275263
#'
276264
#' @examples
277-
#' \dontrun{
278265
#' # Parse data for examples
279266
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
280267
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -303,8 +290,6 @@ calc_group_stat <- function(obj, data, func, groups = NULL, cols = NULL,
303290
#' calc_obs_props(x, "tax_data", groups = hmp_samples$sex)
304291
#' calc_obs_props(x, "tax_data", groups = hmp_samples$sex,
305292
#' out_names = c("Women", "Men"))
306-
#'
307-
#' }
308293
calc_obs_props <- function(obj, data, cols = NULL, groups = NULL,
309294
other_cols = FALSE, out_names = NULL, dataset = NULL) {
310295

@@ -360,7 +345,6 @@ calc_obs_props <- function(obj, data, cols = NULL, groups = NULL,
360345
#' @export
361346
#'
362347
#' @examples
363-
#' \dontrun{
364348
#' # Parse data for examples
365349
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
366350
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -384,8 +368,6 @@ calc_obs_props <- function(obj, data, cols = NULL, groups = NULL,
384368
#' # Rename output columns
385369
#' zero_low_counts(x, "tax_data", cols = c("700035949", "700097855", "700100489"),
386370
#' out_names = c("a", "b", "c"))
387-
#'
388-
#' }
389371
zero_low_counts <- function(obj, data, min_count = 2, use_total = FALSE,
390372
cols = NULL, other_cols = FALSE, out_names = NULL, dataset = NULL) {
391373

@@ -450,7 +432,6 @@ zero_low_counts <- function(obj, data, min_count = 2, use_total = FALSE,
450432
#' @export
451433
#'
452434
#' @examples
453-
#' \dontrun{
454435
#' # Parse data for examples
455436
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
456437
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -474,8 +455,6 @@ zero_low_counts <- function(obj, data, min_count = 2, use_total = FALSE,
474455
#' # Rename output columns
475456
#' rarefy_obs(x, "tax_data", cols = c("700035949", "700097855", "700100489"),
476457
#' out_names = c("a", "b", "c"))
477-
#'
478-
#' }
479458
rarefy_obs <- function(obj, data, sample_size = NULL, cols = NULL,
480459
other_cols = FALSE, out_names = NULL, dataset = NULL) {
481460

@@ -558,7 +537,7 @@ rarefy_obs <- function(obj, data, sample_size = NULL, cols = NULL,
558537
#' @family calculations
559538
#'
560539
#' @examples
561-
#' \dontrun{
540+
#' \donttest{
562541
#' # Parse data for plotting
563542
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
564543
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -725,7 +704,7 @@ compare_groups <- function(obj, data, cols, groups,
725704
#'
726705
#' @export
727706
#'
728-
#' @examples \dontrun{
707+
#' @examples
729708
#' # Parse data for example
730709
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
731710
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -759,8 +738,6 @@ compare_groups <- function(obj, data, cols, groups,
759738
#' # Geting a total for all columns
760739
#' calc_taxon_abund(x, "tax_data", cols = hmp_samples$sample_id,
761740
#' groups = rep("total", nrow(hmp_samples)))
762-
#' }
763-
#'
764741
#' @keywords internal
765742
calc_taxon_abund <- function(obj, data, cols = NULL, groups = NULL,
766743
out_names = NULL, dataset = NULL) {
@@ -824,7 +801,6 @@ calc_taxon_abund <- function(obj, data, cols = NULL, groups = NULL,
824801
#' @family calculations
825802
#'
826803
#' @examples
827-
#' \dontrun{
828804
#' # Parse data for example
829805
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
830806
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -853,8 +829,6 @@ calc_taxon_abund <- function(obj, data, cols = NULL, groups = NULL,
853829
#' calc_n_samples(x, data = "tax_data", other_cols = TRUE)
854830
#' calc_n_samples(x, data = "tax_data", other_cols = 2)
855831
#' calc_n_samples(x, data = "tax_data", other_cols = "otu_id")
856-
#' }
857-
#'
858832
#' @export
859833
calc_n_samples <- function(obj, data, cols = NULL, groups = "n_samples",
860834
other_cols = FALSE, out_names = NULL, drop = FALSE,
@@ -915,7 +889,6 @@ calc_n_samples <- function(obj, data, cols = NULL, groups = "n_samples",
915889
#' @family calculations
916890
#'
917891
#' @examples
918-
#' \dontrun{
919892
#' # Parse data for example
920893
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
921894
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -944,8 +917,6 @@ calc_n_samples <- function(obj, data, cols = NULL, groups = "n_samples",
944917
#' calc_prop_samples(x, data = "tax_data", other_cols = TRUE)
945918
#' calc_prop_samples(x, data = "tax_data", other_cols = 2)
946919
#' calc_prop_samples(x, data = "tax_data", other_cols = "otu_id")
947-
#' }
948-
#'
949920
#' @export
950921
calc_prop_samples <- function(obj, data, cols = NULL, groups = "prop_samples",
951922
other_cols = FALSE, out_names = NULL, drop = FALSE,
@@ -1009,7 +980,6 @@ calc_prop_samples <- function(obj, data, cols = NULL, groups = "prop_samples",
1009980
#' @export
1010981
#'
1011982
#' @examples
1012-
#' \dontrun{
1013983
#' # Parse data for examples
1014984
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
1015985
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -1020,8 +990,6 @@ calc_prop_samples <- function(obj, data, cols = NULL, groups = "prop_samples",
1020990
#'
1021991
#' # Check if there are any reads in each group of samples
1022992
#' counts_to_presence(x, "tax_data", groups = hmp_samples$body_site)
1023-
#'
1024-
#' }
1025993
counts_to_presence <- function(obj, data, threshold = 0, groups = NULL,
1026994
cols = NULL, other_cols = FALSE,
1027995
out_names = NULL, dataset = NULL) {

R/heat_tree--shape_generators.R

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
#' @param radius (\code{numeric} of length 1) The diameter of the circle.
1414
#' @param angle (\code{numeric} of length 1) Angle to rotate points around the center of the circle.
1515
#'
16-
#' @examples
17-
#' \dontrun{
18-
#' library(ggplot2)
19-
#' ggplot(data = polygon_coords(n = 4:13, x = rnorm(10), y = rnorm(10), radius = .5)) +
20-
#' geom_polygon(aes(x = x, y = y, fill = group))
21-
#' }
22-
#'
2316
#' @keywords internal
2417
polygon_coords <- function(n = 5, x = 0, y = 0, radius = 1, angle = 0){
2518
# Define function to make points for a single polygon --------------------------------------------
@@ -58,15 +51,6 @@ polygon_coords <- function(n = 5, x = 0, y = 0, radius = 1, angle = 0){
5851
#' @param y2 (\code{numeric} of length 1) y coordinate of the center of the other end
5952
#' @param width (\code{numeric} of length 1) The width of the line.
6053
#'
61-
#' @examples
62-
#' \dontrun{
63-
#' library(ggplot2)
64-
#' ggplot(data = line_coords(x1 = 1, y1 = 1, x2 = 2, y2 = 2, width = .1)) +
65-
#' geom_polygon(aes(x = x, y = y, fill = group))
66-
#' ggplot(data = line_coords(x1 = rnorm(10), y1 = rnorm(10), x2 = rnorm(10),
67-
#' y2 = rnorm(10), width = rnorm(10)/5)) +
68-
#' geom_polygon(aes(x = x, y = y, fill = group))
69-
#' }
7054
#' @keywords internal
7155
line_coords <- function(x1, y1, x2, y2, width) {
7256
# Define function to make points for a single line rect ------------------------------------------

R/heat_tree--vertex_size.R

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
#' @param y (\code{numeric} of length 1) y coordinate
88
#'
99
#' @return A \code{data.frame}
10-
#'
11-
#' @examples
12-
#' \dontrun{
13-
#' molten_dist(x = 1:5, y = 1:5)
14-
#' }
15-
#'
1610
#' @keywords internal
1711
molten_dist <- function(x, y) {
1812
data <- as.matrix(stats::dist(cbind(x, y)))
@@ -32,11 +26,6 @@ molten_dist <- function(x, y) {
3226
#' @param y (\code{numeric} of length 1) y coordinate of center
3327
#' @param r (\code{numeric} of length 1) The diameter of the circle.
3428
#'
35-
#' @examples
36-
#' \dontrun{
37-
#' inter_circle_gap(x = 1:5, y = 1:5, r = 1:5)
38-
#' }
39-
#'
4029
#' @keywords internal
4130
inter_circle_gap <- function(x, y, r) {
4231
# Force x, y, and r to same length ---------------------------------------------------------------

R/heat_tree.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ heat_tree.Taxmap <- function(.input, ...) {
359359
#' implementation of the label overlap avoidance used in metacoder.
360360
#'
361361
#' @examples
362-
#' \dontrun{
362+
#' \donttest{
363363
#' # Parse dataset for plotting
364364
#' x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
365365
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -411,7 +411,7 @@ heat_tree.Taxmap <- function(.input, ...) {
411411
#'
412412
#' # Label overlap avoidance
413413
#' # You can modfiy how label scattering is handled using the `replel_force` and
414-
#' `repel_iter` options. You can turn off label scattering using the `repel_labels` option.
414+
#' # `repel_iter` options. You can turn off label scattering using the `repel_labels` option.
415415
#' heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs,
416416
#' repel_force = 2, repel_iter = 20000)
417417
#' heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs,

R/heat_tree_matrix.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#' @param dataset DEPRECIATED. use "data" instead.
2626
#'
2727
#' @examples
28-
#' \dontrun{
28+
#' \donttest{
2929
#' # Parse dataset for plotting
3030
#' x <- parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
3131
#' class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
@@ -54,7 +54,6 @@
5454
#' edge_color_interval = c(-3, 3),
5555
#' node_size_axis_label = "Number of OTUs",
5656
#' node_color_axis_label = "Log2 ratio median proportions")
57-
#'
5857
#' }
5958
#'
6059
#' @export

R/old_taxa--taxmap--docs.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ NULL
582582
#' `obj$data` to add columns to.
583583
#'
584584
#' @examples
585-
#' \dontrun{
586585
#' # Get data set by name
587586
#' get_dataset(ex_taxmap, "info")
588587
#'
@@ -592,7 +591,5 @@ NULL
592591
#' # Get data set by T/F vector
593592
#' get_dataset(ex_taxmap, startsWith(names(ex_taxmap$data), "i"))
594593
#'
595-
#' }
596-
#'
597594
#' @name get_dataset
598595
NULL

0 commit comments

Comments
 (0)