Learn R Programming

immunedeconv (version 2.0.3)

find_children: 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.