Skip to content

Commit 45eeb13

Browse files
fixing r cmd check warning messeges
1 parent cf8d8d8 commit 45eeb13

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ Suggests:
5050
phyloseq,
5151
phylotate,
5252
traits,
53-
biomformat
53+
biomformat,
54+
DESeq2
5455
VignetteBuilder: knitr
5556
RoxygenNote: 7.2.3
5657
Date: 2021-06-23

R/calculations--differential_abundance.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#' Differential abundance with DESeq2
22
#'
33
#' EXPERIMENTAL: This function is still being tested and developed; use with caution. Uses the
4-
#' \code{\link{DESeq2}} package to conduct differential abundance analysis of count data. Counts can
4+
#' \code{\link[DESeq2]{DESeq2-package}} package to conduct differential abundance analysis of count data. Counts can
55
#' be of OTUs/ASVs or taxa. The plotting function \code{\link{heat_tree_matrix}} is useful for
66
#' visualizing these results. See details section below for considerations on preparing data for
77
#' this analysis.
88
#'
99
#' Data should be raw read counts, not rarefied, converted to proportions, or modified with any
10-
#' other technique designed to correct for sample size since \code{\link{DESeq2}} is designed to be
11-
#' used with count data and takes into accoutn unequal sample size when determining differential
10+
#' other technique designed to correct for sample size since \code{\link[DESeq2]{DESeq2-package}} is designed to be
11+
#' used with count data and takes into account unequal sample size when determining differential
1212
#' abundance. Warnings will be given if the data is not integers or all sample sizes are equal.
1313
#'
14-
#' @param obj A \code{\link[taxa]{taxmap}} object
14+
#' @param obj A \code{\link[metacoder]{taxmap}} object
1515
#' @param data The name of a table in \code{obj} that contains data for each sample in columns.
1616
#' @param cols The names/indexes of columns in \code{data} to use. By default, all numeric columns
1717
#' are used. Takes one of the following inputs: \describe{ \item{TRUE/FALSE:}{All/No columns will
@@ -28,7 +28,7 @@
2828
#' \describe{
2929
#' \item{'none'}{No log fold change adjustments.}
3030
#' \item{'normal'}{The original DESeq2 shrinkage estimator}
31-
#' \item{'ashr'}{Adaptive shrinkage estimator from the \code{\link{ashr}} package, using a fitted mixture of normals prior.}
31+
#' \item{'ashr'}{Adaptive shrinkage estimator from the \code{ashr} package, using a fitted mixture of normals prior.}
3232
#' }
3333
#' @param ... Passed to \code{\link[DESeq2]{results}} if the \code{lfc_shrinkage} option is "none"
3434
#' and to \code{\link[DESeq2]{lfcShrink}} otherwise.

R/calculations.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ compare_groups <- function(obj, data, cols, groups,
641641
# Get every combination of groups to compare
642642
if (is.null(combinations)) {
643643
if (is.ordered(groups)) {
644-
group_order <- factor(levels(groups), levels = levels(groups), order = TRUE)
644+
group_order <- factor(levels(groups), levels = levels(groups), ordered = TRUE)
645645
} else {
646646
group_order <- unique(groups)
647647
}

R/old_taxa--taxmap--class.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ Taxmap <- R6::R6Class(
914914
dataset_name, '", so there are no taxon IDs.'))
915915
return(NULL)
916916
}
917-
} else if (class(data) == "list" || is.vector(data) || can_be_used_in_taxmap(data)) {
917+
} else if (inherits(data, "list") || is.vector(data) || can_be_used_in_taxmap(data)) {
918918
if (! is.null(names(data))) {
919919
is_valid <- private$ids_are_valid(names(data))
920920
if (all(is_valid)) {

R/old_taxa--taxmap--parsers.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,18 +1066,18 @@ extract_tax_data <- function(tax_data, key, regex, class_key = "taxon_name",
10661066
class_key <- validate_regex_key_pair(class_regex, class_key, multiple_allowed = "info")
10671067

10681068
# classification sep
1069-
if (!is.null(class_sep) && (class(class_sep) != "character" | length(class_sep) != 1)) {
1069+
if (!is.null(class_sep) && (! inherits(class_sep, "character") | length(class_sep) != 1)) {
10701070
stop('"class_sep" must be a character vector of length 1 or NULL')
10711071
}
10721072

10731073
# Boolean options
1074-
if (class(class_rev) != "logical" | length(class_rev) != 1) {
1074+
if (! inherits(class_rev, "logical") | length(class_rev) != 1) {
10751075
stop('"class_rev" must be TRUE/FALSE')
10761076
}
1077-
if (class(include_match) != "logical" | length(include_match) != 1) {
1077+
if (! inherits(include_match, "logical") | length(include_match) != 1) {
10781078
stop('"include_match" must be TRUE/FALSE')
10791079
}
1080-
if (class(include_tax_data) != "logical" | length(include_tax_data) != 1) {
1080+
if (! inherits(include_tax_data, "logical") | length(include_tax_data) != 1) {
10811081
stop('"include_tax_data" must be TRUE/FALSE')
10821082
}
10831083

R/option_parsers.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ parse_seq_input <- function(input = NULL, file = NULL, output_format = "characte
342342
if (output_format == "character") {
343343
if (! is.null(file)) {
344344
result <- read_fasta(file)
345-
} else if (length(input) == 0 || class(input) == "character") {
345+
} else if (length(input) == 0 || inherits(input, "character")) {
346346
result <- input
347-
} else if (class(input) == "DNAbin") {
347+
} else if (inherits(input,"DNAbin")) {
348348
result <- toupper(vapply(as.character(input), paste, character(1), collapse = ""))
349-
} else if (class(input[[1]]) == "SeqFastadna" || class(input) == "list") {
349+
} else if (inherits(input[[1]], "SeqFastadna") || inherits(input, "list")) {
350350
result <- vapply(input, paste, character(1), collapse = "")
351351
} else {
352352
stop(paste0('Could not parse sequence information of class "', class(input), '".'),
@@ -366,17 +366,17 @@ parse_seq_input <- function(input = NULL, file = NULL, output_format = "characte
366366
file <- make_fasta_with_u_replaced(file)
367367
}
368368
result <- ape::read.FASTA(file)
369-
} else if (length(input) == 0 || class(input) == "character") {
369+
} else if (length(input) == 0 || inherits(input, "character")) {
370370
if (u_to_t) {
371371
input <- vapply(input, FUN = gsub, FUN.VALUE = character(1),
372372
pattern = "U", replacement = "T", fixed = TRUE)
373373
input <- vapply(input, FUN = gsub, FUN.VALUE = character(1),
374374
pattern = "u", replacement = "t", fixed = TRUE)
375375
}
376376
result <- ape::as.DNAbin(strsplit(input, split = ""))
377-
} else if (class(input) == "DNAbin") {
377+
} else if (inherits(input, "DNAbin")) {
378378
result <- input
379-
} else if (class(input[[1]]) == "SeqFastadna" || class(input) == "list") {
379+
} else if (inherits(input[[1]], "SeqFastadna") || inherits(input, "list")) {
380380
input <- lapply(input, function(x) {
381381
attributes(x) <- NULL
382382
return(x)

man/calc_diff_abund_deseq2.Rd

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)