Traces and returns all ancestral cell indices for a given cell by recursively following the parent relationships in the cell lineage information.
get_sc_ancestors(cell_info, cell_index)A numeric vector containing the cell indices of all ancestors of the specified cell, ordered from immediate parent to earliest ancestor
This function traverses the cell lineage tree upward from the specified cell, following the parent relationships until it reaches a cell with no parent (NA in the parent column). It builds and returns a vector of all ancestor cell indices encountered during this traversal.
The function is commonly used to reconstruct the complete lineage history of a cell, which is particularly useful for aggregating mutations or other heritable properties that are passed down through cell divisions.