knitr::opts_chunk$set(echo = TRUE)
We take one fate map from our previously constructed panel as an example.
library(qfm) # load the panel of fate maps tree_panel = readRDS("../data/example/tree_panel.rds") type_graph = tree_panel$type_graph[[5]]
First, we generate a color scheme and visualize the topology and commitment times.
col_vec = gr_color_v1(type_graph) plot_type_graph_clean_mod2(type_graph, node_col_mapper = function(x) col_vec[x], show_node_text = T)
Next, we load lineage barcoding parameters that involve 50 independent barcoding sites. Using this data, we simulate cell phylogeny and lineage barcodes, sampling 100 cells from each terminal cell types.
In order to sample a different number of cells from each type, a named numeric vector can be provided to the sample_size
argument.
mut_p = readRDS("../data/example/mut_p_marc1.rds") sim_data = simulate_sc_data_mod2(type_graph, mut_p = mut_p, sample_size = 100)
The results involve the cell phylogeny sim_data$tr
, the lineage barcodes sim_data$sc
, and the sampled population size for each progenitor states sim_data$true_sampled_sizes
. The barcodes and phylogeny can be visualized below. The rownames of the lineage barcode character matrix indicates the cell type of each cell.
plot_barcodes(sc_mat = sim_data$sc, tr = sim_data$tr, tip_celltype = get_type_from_id(rownames(sim_data$sc)), celltype_col = col_vec)
For a detailed specifications of fate maps and mutation parameters, see below.
Quantitative fate maps are implemented as the 'type_graph' S3 objects, with the following attributes.
mutatgenesis parameters are implemented as 'mut_params' S3 objects, and have the following attributes.
Suppose the array of barcoding sites have $J$ total elements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.