@@ -38,13 +38,13 @@ First, we generate a toy dataset with 500 mutations
3838``` {r, cache=TRUE}
3939set.seed(1234)
4040numSnv <- 500
41- ccfSet <- c(1, 0.4 , 0.6 ) # true ccf pool
41+ ccfSet <- c(1, 0.7 , 0.3 ) # true ccf pool
4242ccfTrue <- sample(ccfSet, numSnv, c(0.5,0.2,0.3), replace = T) # simulate true clusters
43- purity <- 0.9
43+ purity <- 0.8
4444cnPoolMaj <- c(1,2,3,4) # a pool of possible major copy numbers
4545cnPoolMin <- c(0,1,2) # a pool of possible minor copy numbers
46- cnPoolMajFractions <- c(0.50, 0.30, 0.1,0.1 ) # prevalence of possible major copy numbers
47- cnPoolMinFractions <- c(1/4 , 1/2 , 1/4 ) # prevalence of possible minor copy numbers
46+ cnPoolMajFractions <- c(1/4, 1/4, 1/4, 1/4 ) # prevalence of possible major copy numbers
47+ cnPoolMinFractions <- c(1/3 , 1/3 , 1/3 ) # prevalence of possible minor copy numbers
4848
4949cnProfile = GenerateCopyNumberProfile(cnPoolMaj, cnPoolMin,
5050 cnPoolMajFractions, cnPoolMinFractions, numSnv)
@@ -55,7 +55,7 @@ head(cnProfile) # column 1: minor copy number, column 2: major copy number, colu
5555
5656Simulate cancer cell fractions, multiplicity, and reads counts
5757``` {r}
58- baseDepth = 50
58+ baseDepth = 40
5959mydata <- data.frame(mutation_id = paste0("ss","_", seq_len(numSnv)) ,
6060 ccf_true = ccfTrue,
6161 minor_cn = cnProfile[,1],
@@ -66,9 +66,9 @@ mydata <- data.frame(mutation_id = paste0("ss","_", seq_len(numSnv)) ,
6666
6767mydata <- dplyr::mutate(rowwise(mydata),
6868 mult_true = sample(seq(1,if (major_cn ==1) { 1 } else {major_cn}), 1), # simulate multiplicity
69- vaf = cp2ap(ccf_true, purity, normal_cn, total_cn, total_cn, mult_true), # simulate vaf
69+ vaf_true = cp2ap(ccf_true, purity, normal_cn, total_cn, total_cn, mult_true), # simulate vaf
7070 total_counts = rpois(1, total_cn/2 * baseDepth), # simulate total read counts
71- var_counts = rbinom(1, total_counts, vaf ), # simulate variant read counts
71+ var_counts = rbinom(1, total_counts, vaf_true ), # simulate variant read counts
7272 ref_counts = total_counts - var_counts)
7373
7474head(mydata)
@@ -107,6 +107,7 @@ The `results` list contains four variables:
107107 * ` ccube_ccf ` : Event CCF, i.e. CCF estimates for individual SNV
108108* ` results ` : A list all fitted models. Each element is structured the same as ` res `
109109* ` lb ` : Best ELBO across fitted models
110+ * ` droppedSsm ` : Dropped variants (i.e. variants in regions where major copy number is zero)
110111
111112Finally, we make a default plot of Ccube results
112113``` {r}
0 commit comments