Get ancestors to Cell Ontology IDs

get_ancestors(
  meta,
  id_col = "cell_ontology_id",
  ontology = NULL,
  levels_up = 1,
  ancestor_col = paste0("ancestor", levels_up)
)

Arguments

meta

Metadata

id_col

Name of the column in meta with the ontology IDs.

ontology

A controlled ontology object of class ontology_index.

levels_up

How many levels up the ontology hierarchy should ancestors be retrieved from.

ancestor_col

Name of the column where ancestor IDs will be stored.

Value

The original meta object with the new ancestor_col.

Examples

if (FALSE) { # \dontrun{
    hpca_sce <- celldex::HumanPrimaryCellAtlasData()
    meta_ancest <- get_ancestors(
        meta = SummarizedExperiment::colData(hpca_sce),
        id_col = "label.ont"
    )
} # }