% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/seurat_integration.R
\name{seurat_to_gedi}
\alias{seurat_to_gedi}
\title{Convert Seurat Object to GEDI Model}
\usage{
seurat_to_gedi(
  seurat_object,
  assay = "RNA",
  slot = "counts",
  sample_column = "orig.ident",
  subset_samples = NULL,
  K = 10,
  mode = "Bl2",
  C = NULL,
  H = NULL,
  validate_counts = TRUE,
  use_variable_features = TRUE,
  verbose = TRUE,
  ...
)
}
\arguments{
\item{seurat_object}{Seurat object}

\item{assay}{Character, which assay to use (default: "RNA")}

\item{slot}{Character, which slot/layer to extract (default: "counts").
For Seurat v5 with split layers (e.g., counts.CTRL, counts.STIM),
this will automatically detect and combine all matching layers.}

\item{sample_column}{Character, column name in meta.data for sample labels
(default: "orig.ident")}

\item{subset_samples}{Character vector, subset to specific samples (default: NULL = all)}

\item{K}{Integer, number of latent factors (default: 10)}

\item{mode}{Character, normalization mode: "Bl2" or "Bsphere" (default: "Bl2")}

\item{C}{Gene-level prior matrix (genes x pathways) (default: NULL)}

\item{H}{Sample-level covariate matrix (covariates x samples) (default: NULL)}

\item{validate_counts}{Logical, whether to validate data appears to be counts
(default: TRUE)}

\item{use_variable_features}{Logical, whether to subset to highly variable features
(default: TRUE). If TRUE, uses genes from VariableFeatures(seurat_object).}

\item{verbose}{Logical, whether to print progress messages (default: TRUE)}

\item{...}{Additional arguments passed to CreateGEDIObject()}
}
\value{
GEDI R6 object
}
\description{
Extracts count data from a Seurat object and creates a GEDI model.
Automatically validates that the data contains raw counts (not normalized).
Handles both Seurat v4 and v5, including split layers in v5.
}
\examples{
\donttest{
library(Seurat)

# Load example data
pbmc <- SeuratObject::pbmc_small

# Basic usage
gedi_model <- seurat_to_gedi(
  seurat_object = pbmc,
  sample_column = "orig.ident",
  K = 15
)

# Train the model
gedi_model$train(iterations = 10)
}

}
