Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CellsByIdentities into S3 generic #202

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,27 @@ Cells <- function(x, ...) {
UseMethod(generic = 'Cells', object = x)
}

#' Get cell names grouped by identity class
#'
#' @template param-dots-method
#' @param object An object
#'
#' @return A named list where names are identity classes and values are vectors
#' of cells belonging to that class
#'
#' @rdname CellsByIdentities
#' @export CellsByIdentities
#'
#' @concept data-access
#' @family dimnames
#'
#' @examples
#' CellsByIdentities(x = pbmc_small)
#'
CellsByIdentities <- function(object, ...) {
UseMethod(generic = 'CellsByIdentities', object = object)
}

#' Check Matrix Validity
#'
#' @template param-dots-method
Expand Down
9 changes: 4 additions & 5 deletions R/seurat.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,23 @@ setClass(

#' Get cell names grouped by identity class
#'
#' @param object A Seurat object
#' @param idents A vector of identity class levels to limit resulting list to;
#' defaults to all identity class levels
#' @param cells A vector of cells to grouping to
#' @param return.null If no cells are requested, return a \code{NULL};
#' by default, throws an error
#'
#' @return A named list where names are identity classes and values are vectors
#' of cells belonging to that class
#'
#' @rdname CellsByIdentities
#' @export
#' @method CellsByIdentities Seurat
#'
#' @concept data-access
#'
#' @examples
#' CellsByIdentities(object = pbmc_small)
#'
CellsByIdentities <- function(

CellsByIdentities.Seurat <- function(
object,
idents = NULL,
cells = NULL,
Expand Down