Run GPT on a metadata table.

gpt(
  clusts,
  label_var = "dataset",
  cluster_var = "seurat_clusters",
  terms_per_cluster = 5,
  force_new = FALSE,
  verbose = TRUE
)

Arguments

clusts

data.frame/data.table with the per-cell metadata and cluster assignments.

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.

verbose

Whether to print messages.

Value

A data.table with GPT summaries per cluster.

Examples

# Show expected input format (API call not executed)
data("pseudo_seurat")
clusts <- pseudo_seurat[[]]
head(clusts[, c("celltype", "cluster")])
#>                         celltype cluster
#> human.DRONC_human.ASC1      ASC1       5
#> human.DRONC_human.ASC2      ASC2       5
#> human.DRONC_human.END        END       9
#> human.DRONC_human.exCA1    exCA1       0
#> human.DRONC_human.exCA3    exCA3       0
#> human.DRONC_human.exDG      exDG       0