Ask chatGPT to summarise each cluster based on the samples metadata.

run_gpt(
  obj = NULL,
  reduction = "UMAP",
  label_var = "label",
  cluster_var = "seurat_clusters",
  terms_per_cluster = 3,
  force_new = FALSE,
  return_all_results = FALSE,
  verbose = TRUE
)

Arguments

obj

Single-cell data object.

reduction

Name of the reduction to use (case insensitive).

label_var

Which cell metadata column to input to NLP analysis.

cluster_var

Which cell metadata column to use to identify which cluster each cell is assigned to.

terms_per_cluster

The maximum number of words to return per cluster.

force_new

If NLP results are already detected the metadata, set force_new=TRUE to replace them with new results.

return_all_results

Whether to return just the obj with updated metadata (TRUE), or all intermediate results (FALSE).

verbose

Whether to print messages.

Value

The input object with GPT summary added to metadata, or if return_all_results=TRUE, a list with the object and intermediate results.

Examples

# Show expected input (API call not executed)
data("pseudo_seurat")
print(class(pseudo_seurat))
#> [1] "Seurat"
#> attr(,"package")
#> [1] "SeuratObject"