Learn R Programming

GeRnika (version 1.1.0)

create_U: Calculate tumor clone frequencies in samples

Description

This function calculates the frequencies of each clone in a set of samples, given the global clone proportions in the tumor and their spatial distribution.

Usage

create_U(B, m, selection, n_cells = 100)

Value

A matrix where each row corresponds to a sample, and each column corresponds to a clone. The value at the i-th row and j-th column is the frequency of the j-th clone in the i-th sample.

Arguments

B

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

m

An integer representing the number of samples taken from the tumor.

selection

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

n_cells

An integer representing the number of cells sampled from the multinomial distribution. Default is 100.

Examples

Run this code

# Create random topology with 20 nodes and k = 3
B <- create_B(20, 3)

# Create U matrix with parameter m=4 and "positive" selection
U <- create_U(B = B, m = 4, selection = "positive")

Run the code above in your browser using DataLab