Learn R Programming

GeRnika (version 1.0.0)

phylotree_to_B: Get B matrix from Phylotree object.

Description

This function retrieves the B matrix of a Phylotree object.

Usage

phylotree_to_B(phylotree)

Value

A data.frame representing the B matrix of the phylogenetic tree.

Arguments

phylotree

A Phylotree class object.

Examples

Run this code
# Get the B matrix of a tumor instance
# composed by 10 subpopulations of
# clones
B <- create_instance(
       n = 10, 
       m = 4, 
       k = 1, 
       selection = "neutral")$B

# Create a new 'Phylotree' object
# on the basis of the B matrix
phylotree <- B_to_phylotree(B)

# Get the B matrix of the phyotree
b1 <- phylotree_to_B(phylotree)

Run the code above in your browser using DataLab