Skip to contents

Assess clustering quality directly on a Seurat object

Usage

RunAssessment(
  object,
  cluster_col = NULL,
  assay = NULL,
  use = "pca",
  dims = 1:50,
  features = NULL,
  classifier = "LR",
  penalty = "l1",
  test_size = 0.5,
  n_per_class = 100,
  cv = 5,
  seed = 1,
  n_cores = NULL,
  verbose = TRUE,
  ...
)

Arguments

object

Seurat object

cluster_col

Column name in meta.data containing cluster labels (default: uses Idents)

assay

Assay to use (default: DefaultAssay)

use

Feature space to use: "raw" (normalized data), "pca", or other reduction name

dims

Dimensions to use for PCA/reduction (default: 1:50)

features

Optional: specific features to use. If NULL, uses all (for raw) or VariableFeatures

classifier

Classifier type: "LR", "RF", etc.

penalty

For LR: "l1" or "l2"

test_size

Fraction for test set

n_per_class

Max samples per class

cv

Cross-validation folds

seed

Random seed

n_cores

Number of cores

verbose

Print progress

...

Additional arguments passed to self_projection

Value

An scClustEval result object

Details

This function extracts the appropriate data from the Seurat object and runs self_projection assessment. By default, it uses PCA coordinates if available, otherwise normalized data.

For Seurat V4, uses GetAssayData with slots. For Seurat V5, automatically uses LayerData when appropriate.

Examples

if (FALSE) { # \dontrun{
# Assess default clustering
result <- RunAssessment(seurat_obj)

# Assess specific clustering with PCA
result <- RunAssessment(
  seurat_obj,
  cluster_col = "seurat_clusters",
  use = "pca",
  dims = 1:30
)

# Assess with raw expression
result <- RunAssessment(
  seurat_obj,
  cluster_col = "manual_annotation",
  use = "raw"
)
} # }