sim_seqdata | R Documentation |
Generate singe cell barcode data set with tree shaped lineage information
sim_seqdata(
sim_n = 200,
m = 200,
mu_d = 0.03,
d = 15,
n_s = 23,
outcome_prob = NULL,
p_d = 0.003
)
sim_n |
Number of cell samples to simulate. |
m |
Number of targets. |
mu_d |
Mutation rate. (a scalar or a vector) |
d |
Number of cell divisions. |
n_s |
Number of possible outcome states |
outcome_prob |
Outcome probability vector (default is NULL) |
p_d |
Dropout probability |
The result is a list containing two objects, 'seqs' and 'tree'. The 'seqs' is 'phyDat' object of 'sim_n' number of simulated barcodes corresponding to each cell, and The 'tree' is a 'phylo' object, a ground truth tree structure for the simulated data.
Il-Youp Kwak
library(DCLEAR)
library(phangorn)
library(ape)
set.seed(1)
mu_d1 = c( 30, 20, 10, 5, 5, 1, 0.01, 0.001)
mu_d1 = mu_d1/sum(mu_d1)
simn = 10 # number of cell samples
m = 10 ## number of targets
sD = sim_seqdata(sim_n = simn, m = m, mu_d = 0.03,
d = 12, n_s = length(mu_d1), outcome_prob = mu_d1, p_d = 0.005 )
## RF score with hamming distance
D_hm = dist.hamming(sD$seqs)
tree_hm = NJ(D_hm)
RF.dist(tree_hm, sD$tree, normalize = TRUE)
## RF score with weighted hamming
InfoW = -log(mu_d1)
InfoW[1:2] = 1
InfoW[3:7] = 4.5
D_wh = dist_weighted_hamming(sD$seqs, InfoW, dropout=FALSE)
tree_wh = NJ(D_wh)
RF.dist(tree_wh, sD$tree, normalize = TRUE)
## RF score with weighted hamming, cosidering dropout situation
nfoW = -log(mu_d1)
InfoW[1] = 1
InfoW[2] = 12
InfoW[3:7] = 3
D_wh2 = dist_weighted_hamming(sD$seqs, InfoW, dropout = TRUE)
tree_wh2= NJ(D_wh2)
RF.dist(tree_wh2, sD$tree, normalize = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.