find_children: Recursive helper function for map_cell_types.

View source: R/cell_type_mapping.R

find_childrenR Documentation

Recursive helper function for map_cell_types.

Description

Traverses the cell type hierarchy, summing up cell type fractions when necessary.

Usage

find_children(node, fractions, method_dataset = NULL)

Arguments

node

data.tree::Node corresponding to a controlled vocabulary cell type

fractions

a named list of fractions for each method_cell_type

method_dataset

character identifying the method or dataset in the celltype_mapping. If NULL, the input vector already uses controlled vocabulary.

Value

numeric Either (1) the value of the method_cell_type mapped to cell_type, (2) the sum of all child nodes (recursively) of cell_type (3) NA, if the mapping cannot be resolved, i.e. at least one of the child nodes is missing.


grst/immunedeconv documentation built on Nov. 10, 2023, 1:33 a.m.