Learn R Programming

GeRnika (version 1.0.0)

.distribute_freqs: Distribute frequencies among clone and its children clones

Description

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.

Usage

.distribute_freqs(B, clone_idx, clone_proportions, selection)

Value

A numeric vector representing the updated proportions of each clone in the phylogenetic tree.

Arguments

B

A matrix representing the mutation relationships between the nodes in the phylogenetic tree (B matrix).

clone_idx

An integer representing the index of the clone whose own proportion and its children's proportions are going to be updated.

clone_proportions

A numeric vector representing the proportions of each clone in the phylogenetic tree.

selection

A character string representing the evolutionary mode the tumor follows. This should be either "positive" or "neutral".