R version 4.5.0 RC (2025-04-04 r88118 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > if (packageVersion("CloneSeeker") < "0.9.0") { + stop("You need to update 'CloneSeeker'.") + } > library("CloneSeeker") > > psiSets <- list(c(1), # only one clone + c(0.7, 0.3), # two clones + c(0.6, 0.25, 0.15), # three clones + c(0.5, 0.25, 0.15, 0.10)) # four clones > > paramSets <- data.frame(nu = rep(c(0, 100, 100), each = 2), + pcnv = rep(c(1, 0.5, 0), each = 2), + norm.contam = rep(c(TRUE, FALSE), times = 3)) > > paramSets <- data.frame(nu = rep(c(0, 100, 100)), + pcnv = rep(c(1, 0.5, 0))) > > ######################################### > ### Simulate the data sets. > suppressWarnings( RNGversion("3.5.0") ) > set.seed(20248) > simData <- list() > for (psi in psiSets) { + cat("Working on psi =", psi, "\n", file=stderr()) + for (J in 1:nrow(paramSets)) { + cat("Working on set J =", J, "\n", file=stderr()) + tumor <- Tumor(psi, + rounds = 100, + cnmax = 4, + nu = paramSets$nu[J], + pcnv = paramSets$pcnv[J], + norm.contam = FALSE) + dset <- generateTumorData(tumor, + snps.seq = 10000, + snps.cgh = 600000, + mu = 70, + sigma.reads = 25, + sigma0.lrr = 0.15, + sigma0.baf = 0.03, + density.sigma = 0.1) + simData[[1 + length(simData)]] <- list(tumor = tumor, + dset = dset, + psi = psi, + params = paramSets[J,]) + } + } Working on psi = 1 Working on set J = 1 Working on set J = 2 Working on set J = 3 Working on psi = 0.7 0.3 Working on set J = 1 Working on set J = 2 Working on set J = 3 Working on psi = 0.6 0.25 0.15 Working on set J = 1 Working on set J = 2 Working on set J = 3 Working on psi = 0.5 0.25 0.15 0.1 Working on set J = 1 Working on set J = 2 Working on set J = 3 > length(simData) [1] 12 > > ######################################### > ### Set up algorithm parameters > psis.20 <- generateSimplex(20,5) > cnmodels <- as.matrix(expand.grid(lapply(1:5, function(i){ 0:5 }))) > pars <- list(sigma0=5, theta = 0.9, ktheta = 0.3, mtheta = 0.9, + alpha = 0.5, thresh = 0.04, cutoff = 100, Q = 100, iters = 4) > > ### Don't run full tests at CRAN. > if (Sys.getenv("KRC_DO_ALL_TESTS") == "TRUE") { + testset <- 1:length(simData) + } else { + testset <- c(1, 5) + } > > for (J in testset) { + cat("\n\nDataset", J, "\n", file=stdout()) + dset <- simData[[J]]$dset + ## Cheat and limit the number of mutations to speed up the algorithm for CRAN + ## This code was copied out of the "seekClones" algorithm. + seqdata <- dset$seq.data + if(nrow(seqdata) > 0) { + read.den <- density(seqdata$refCounts) + peak <- read.den$x[which.max(read.den$y)] + } + mutdata <- seqdata[seqdata$status == 'somatic',] + if (nrow(mutdata) > 1) { + mut.filt <- CloneSeeker:::filterMutations(mutdata, mu=peak, threshold=3) + seqdata <- mut.filt$mat + if (nrow(seqdata) > 10) seqdata <- seqdata[1:10,] + } + ## "Try" was placed here during debugging. These should succeed. + ra <- try( runAlg(dset$cn.data, seqdata, + cnmodels, psis.20, + pars = pars, imputedCN = NULL) ) + if (inherits(ra, "try-error")) { + cat(ra, "\n", stdout()) + } else { + cat("psi:\n") + print(ra$psi) + cat("A,B:\n") + print(cbind(A = ra$A, B = ra$B)) + cat("eta:\n") + print(data.frame(etaA = ra$etaA, etaB = ra$etaB)) + cat("indices:\n") + print(lapply(ra$indices, summary)) + cat("filtered data:\nMutations:\n") + print(summary(ra$filtered.data$mutdata.filt)) + if (J != 5) { + cat("CNVs:\n") + print(summary(as.matrix(ra$filtered.data$cndata.filt), digits = 2)) + } + print(summary(ra$mutated)) + cat("posteriors\n") + print(summary(ra$psiPosts)) + } + } Dataset 1 psi: [1] 1 0 0 0 0 A,B: 2 1 60 1 0 0 0 0 0 0 0 0 0 133 2 0 0 0 0 1 0 0 0 0 239 1 0 0 0 0 0 0 0 0 0 249 2 0 0 0 0 1 0 0 0 0 eta: etaA etaB 1 1 0 2 2 1 3 1 0 4 2 1 indices: $indices.cn Min. 1st Qu. Median Mean 3rd Qu. Max. 60.0 114.8 186.0 170.2 241.5 249.0 $mutids.filt Min. 1st Qu. Median Mean 3rd Qu. Max. filtered data: Mutations: chr seg mut.id refCounts varCounts Min. : NA Min. : NA Min. : NA Min. : NA Min. : NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA Median : NA Median : NA Median : NA Median : NA Median : NA Mean :NaN Mean :NaN Mean :NaN Mean :NaN Mean :NaN 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA Max. : NA Max. : NA Max. : NA Max. : NA Max. : NA VAF totalCounts status Min. : NA Min. : NA Length:0 1st Qu.: NA 1st Qu.: NA Class :character Median : NA Median : NA Mode :character Mean :NaN Mean :NaN 3rd Qu.: NA 3rd Qu.: NA Max. : NA Max. : NA CNVs: chr seg LRR BAF X Min. : 3.0 Min. : 60 Min. :-0.303 Min. :0.67 Min. :1.0 1st Qu.: 6.8 1st Qu.:115 1st Qu.:-0.297 1st Qu.:0.67 1st Qu.:1.0 Median :14.0 Median :186 Median :-0.061 Median :0.83 Median :1.5 Mean :13.2 Mean :170 Mean :-0.062 Mean :0.83 Mean :1.5 3rd Qu.:20.5 3rd Qu.:242 3rd Qu.: 0.173 3rd Qu.:1.00 3rd Qu.:2.0 Max. :22.0 Max. :249 Max. : 0.176 Max. :1.00 Max. :2.0 Y markers Min. :0.00048 Min. :1645 1st Qu.:0.00057 1st Qu.:1863 Median :0.49530 Median :1958 Mean :0.49750 Mean :2077 3rd Qu.:0.99223 3rd Qu.:2172 Max. :0.99892 Max. :2747 Mode NA's logical 1 posteriors Min. 1st Qu. Median Mean 3rd Qu. Max. -38.431 -16.621 1.287 -6.668 1.287 1.287 Dataset 5 psi: [1] 0.6770672 0.3229328 0.0000000 0.0000000 0.0000000 A,B: Var1 Var2 Var1 Var2 34 1 1 0 0 0 0 1 0 0 0 67 1 1 0 0 0 1 2 0 0 0 95 1 2 0 0 0 1 1 0 0 0 124 1 1 0 0 0 1 1 0 0 0 207 1 1 0 0 0 2 1 0 0 0 359 2 1 0 0 0 1 1 0 0 0 404 2 1 0 0 0 1 1 0 0 0 eta: etaA etaB 1 1.000000 0.3229328 2 1.000000 1.3229328 3 1.322933 1.0000000 4 1.000000 1.0000000 5 1.000000 1.6770672 6 1.677067 1.0000000 7 1.677067 1.0000000 indices: $indices.cn Min. 1st Qu. Median Mean 3rd Qu. Max. 34.0 81.0 124.0 184.3 283.0 404.0 $mutids.filt Min. 1st Qu. Median Mean 3rd Qu. Max. 1.0 372.8 1147.5 3308.6 6060.5 9265.0 filtered data: Mutations: chr seg mut.id refCounts varCounts Min. :1 Min. : 1.00 Min. : 1.0 Min. : 48.0 Min. :16.00 1st Qu.:1 1st Qu.: 4.50 1st Qu.: 372.8 1st Qu.: 76.0 1st Qu.:33.25 Median :1 Median : 7.00 Median :1147.5 Median : 84.5 Median :48.50 Mean :1 Mean : 6.00 Mean :3308.6 Mean : 91.2 Mean :45.80 3rd Qu.:1 3rd Qu.: 7.75 3rd Qu.:6060.5 3rd Qu.:103.5 3rd Qu.:56.25 Max. :1 Max. :10.00 Max. :9265.0 Max. :162.0 Max. :74.00 VAF totalCounts status Min. :0.1649 Min. : 86.0 Length:10 1st Qu.:0.2914 1st Qu.:122.2 Class :character Median :0.3333 Median :131.5 Mode :character Mean :0.3375 Mean :137.0 3rd Qu.:0.3632 3rd Qu.:156.0 Max. :0.6066 Max. :194.0 V1 V2 V3 V4 V5 Min. :0.0 Min. :0.0 Min. :0 Min. :0 Min. :0 1st Qu.:1.0 1st Qu.:0.0 1st Qu.:0 1st Qu.:0 1st Qu.:0 Median :1.0 Median :0.0 Median :0 Median :0 Median :0 Mean :0.8 Mean :0.4 Mean :0 Mean :0 Mean :0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:0 3rd Qu.:0 3rd Qu.:0 Max. :1.0 Max. :1.0 Max. :0 Max. :0 Max. :0 posteriors Min. 1st Qu. Median Mean 3rd Qu. Max. -151.65 -138.43 -69.28 -91.18 -63.23 -57.25 > > if (FALSE) { # save the profiling code for later + Rprof("profile3.txt") + for (J in c(1, 5, 9)) { + dset <- simData[[J]]$dset + ra <- seekClones(dset$cn.data, dset$seq.data, + cnmodels, psis.20, + pars = pars, imputedCN = NULL) + } + Rprof(NULL) + summaryRprof("profile3.txt") + } > > proc.time() user system elapsed 69.29 1.34 70.67