R/excludeNonCancerCells-methods.R

#' @name excludeNonCancerCells
#' @inherit AcidGenerics::excludeNonCancerCells
#' @note Updated 2023-10-05.
#'
#' @inheritParams AcidRoxygen::params
#'
#' @param ... Additional arguments.
#'
#' @examples
#' data(cello)
#'
#' ## Cellosaurus ====
#' object <- cello
#' print(dim(object))
#' object <- excludeNonCancerCells(object)
#' print(dim(object))
NULL



## Updated 2023-10-05.
`excludeNonCancerCells,Cellosaurus` <- # nolint
    function(object) {
        assert(
            validObject(object),
            isSubset("isCancer", colnames(object))
        )
        keep <- object[["isCancer"]]
        object <- object[keep, , drop = FALSE]
        object
    }



#' @rdname excludeNonCancerCells
#' @export
setMethod(
    f = "excludeNonCancerCells",
    signature = signature(object = "Cellosaurus"),
    definition = `excludeNonCancerCells,Cellosaurus`
)
acidgenomics/r-cellosaurus documentation built on March 12, 2024, 2:37 p.m.