scToNeb: Retrieve data from Seurat or SingleCellExperiment object to...

View source: R/scToNeb.R

scToNebR Documentation

Retrieve data from Seurat or SingleCellExperiment object to prepare for use in nebula

Description

Extracts count matrix and metadata from Seurat or SingleCellExperiment objects and formats them for use with the nebula function. Handles predictors, sample IDs, and offset factors.

Usage

scToNeb(
  obj,
  assay = NULL,
  id = NULL,
  pred = NULL,
  offset = NULL,
  verbose = TRUE
)

Arguments

obj

Seurat or SingleCellExperiment object to create data set for Nebula.

assay

Assay to retrieve counts from the corresponding Seurat count matrix.

id

Sample ID to use metadata object i.e. obj$id.

pred

Character vector of predictors from metadata in Seurat or SingleCellExperiment objects.

offset

Metadata column corresponding to per-cell scaling factor e.g. TMM.

verbose

Indicating whether to print additional messages.

Details

Retrieve data from Seurat or SingleCellExperiment object to prepare for use in nebula

Value

data_neb: A list usable for nebula.

Examples

## Not run: 
library(Seurat)
library(nebula)

sample_seurat <- load_sample_seurat()
re <- scToNeb(obj = sample_seurat, assay = "RNA", id = "replicate", pred = c("celltype", "tech"))

## End(Not run)

nebula documentation built on July 12, 2026, 9:06 a.m.