R/seurat_to_se.R

Defines functions seurat_to_se

Documented in seurat_to_se

#' Convert: \code{Seurat} ==> \code{SummarizedExperiment}
#'
#' @inheritParams converters
#' @inheritParams to_se
#' @returns A \link[SummarizedExperiment]{SummarizedExperiment} object.
#'
#' @export
#' @examples
#' obj <- example_obj("seurat")
#' obj2 <- seurat_to_se(obj)
seurat_to_se <- function(obj,
                          as_sce=TRUE,
                          verbose=TRUE){
  messager_to()
  obj2 <- Seurat::as.SingleCellExperiment(obj)
  if(isFALSE(as_sce)){
    obj2 <- sce_to_se(obj = obj2,
                      verbose = verbose)
  }
  return(obj2)
}
bschilder/scKirby documentation built on Oct. 2, 2024, 10:16 p.m.