Skip to content

Commit 25bcbbe

Browse files
committed
Fix utils vignettes
1 parent 0ece08d commit 25bcbbe

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

R/utils.R

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,24 @@
44
#' \code{\link[TreeSummarizedExperiment:TreeSummarizedExperiment-constructor]{TreeSummarizedExperiment}}
55
#' that are compulsory when using certain panels.
66
#'
7+
#' @param se a
8+
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
9+
#' object.
10+
#'
11+
#' @param initial \code{Panel vector}. A list of panel objects to check.
12+
#'
13+
#' @param panel.class \code{Character vector}. A list of panel names
14+
#' corresponding to panel objects in \code{initial}.
15+
#'
16+
#' @param panel.fun \code{Function scalar}. The element of \code{se} whose
17+
#' existance should be checked.
18+
#'
19+
#' @param wtext \code{Character scalar}. Text of the warning message returned
20+
#' if \code{panel.fun} does not exist or is empty.
21+
#'
722
#' @return
823
#' \code{.check_panel} returns the input \code{initial} list of panels excluding
9-
#' the checked panel if \code{panel_fun} is \code{NULL} or empty.
24+
#' the checked panel if \code{panel.fun} is \code{NULL} or empty.
1025
#' \code{.check_all_panels} applies \code{.check_panel} to multiple panels and
1126
#' returns the a filtered version of \code{initial}.
1227
#'
@@ -60,15 +75,15 @@ NULL
6075
#' @export
6176
#' @importFrom S4Vectors isEmpty
6277
#' @importFrom methods is
63-
.check_panel <- function(se, panel_list, panel_class, panel_fun, wtext) {
78+
.check_panel <- function(se, initial, panel.class, panel.fun, wtext) {
6479

65-
no_keep <- unlist(lapply(panel_list, function(x) is(x, panel_class)))
80+
no_keep <- unlist(lapply(initial, function(x) is(x, panel.class)))
6681

67-
if( any(no_keep) && (is.null(panel_fun(se)) || isEmpty(panel_fun(se))) ){
68-
panel_list <- panel_list[!no_keep]
69-
warning("no valid ", as.character(substitute(panel_fun)),
70-
" fields for ", panel_class, call. = FALSE)
82+
if( any(no_keep) && (is.null(panel.fun(se)) || isEmpty(panel.fun(se))) ){
83+
initial <- initial[!no_keep]
84+
warning("no valid ", as.character(substitute(panel.fun)),
85+
" fields for ", panel.class, call. = FALSE)
7186
}
7287

73-
return(panel_list)
88+
return(initial)
7489
}

man/utils.Rd

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

0 commit comments

Comments
 (0)