This function distributes frequencies among the clones in a multifurcation of a phylogenetic tree. It uses a Dirichlet distribution to generate random proportions for a clone and its children, and then normalizes the children's proportions to the parent's proportion.
This is an internal function used by calc_clone_proportions
.
.distribute_freqs(B, clone_idx, clone_proportions, selection)
A numeric vector representing the updated proportions of each clone in the phylogenetic tree.
A matrix representing the mutation relationships between the nodes in the phylogenetic tree (B matrix).
An integer representing the index of the clone whose own proportion and its children's proportions are going to be updated.
A numeric vector representing the proportions of each clone in the phylogenetic tree.
A character string representing the evolutionary mode the tumor follows. This should be either "positive" or "neutral".