Skip to content

Commit

Permalink
Remove use of utils:::findMatches so we aren't using the triple-colon
Browse files Browse the repository at this point in the history
  • Loading branch information
mojaveazure committed Apr 11, 2019
1 parent c10d52e commit df87dd6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -4060,25 +4060,32 @@ WriteH5AD.Seurat <- function(
# Methods for R-defined generics
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#' @importFrom utils .DollarNames
#' @export
#' @method .DollarNames JackStrawData
#'
".DollarNames.JackStrawData" <- function(x, pattern = '') {
utils:::findMatches(pattern = pattern, values = slotNames(x = x))
slotnames <- as.list(x = slotNames(x = x))
names(x = slotnames) <- unlist(x = slotnames)
return(.DollarNames(x = slotnames, pattern = pattern))
}

#' @importFrom utils .DollarNames
#' @export
#' @method .DollarNames Seurat
#'
".DollarNames.Seurat" <- function(x, pattern = '') {
utils:::findMatches(pattern = pattern, values = colnames(x = x[[]]))
meta.data <- as.list(x = colnames(x = x[[]]))
names(x = meta.data) <- unlist(x = meta.data)
return(.DollarNames(x = meta.data, pattern = pattern))
}

#' @importFrom utils .DollarNames
#' @export
#' @method .DollarNames SeuratCommand
#'
".DollarNames.SeuratCommand" <- function(x, pattern = '') {
params <- slot(object = x, name = "params")
utils:::findMatches(pattern = pattern, names(x = params))
return(.DollarNames(x = slot(object = x, name = "params"), pattern = pattern))
}

#' @export
Expand Down

0 comments on commit df87dd6

Please sign in to comment.