Description Usage Arguments Value Examples
View source: R/positiveFusedLasso.R
Positive fused Lasso function
1 2 | positiveFusedLasso(Y, Zt, lambda, intercept = FALSE, eps = 0.1,
max.iter = 50L, warn = FALSE, verbose = FALSE)
|
Y |
A list of one or two matrices named |
Zt |
A list of one or two J-by-K matrices names |
lambda |
A numeric with one or two real numbers, the coefficients for the fused penalty for minor (and possibly the major) copy numbers. |
intercept |
logical: should an intercept be included in the model?
Defaults to |
eps |
Criterion to stop algorithm (when W do not change sqrt(sum((W-W.old)^2) <= eps). |
max.iter |
Maximum number of iterations of the algorithm. |
warn |
Issue a warning if |
verbose |
If you want to print some information during running. |
An object of class posFused.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | set.seed(7)
len <- 700*10 ## Number of loci
K <- 2L ## Number of subclones
n <- 5L ## Number of samples
bkps <- list(
c(20, 30, 50, 60)*100,
c(10, 40, 60)*100)
regions <- list(
c("(1,1)", "(1,2)", "(1,1)", "(0,1)", "(1,1)"),
c("(0,1)", "(1,1)", "(1,2)", "(1,1)"))
datSubClone <- buildSubclones(len, K, bkps, regions, eps=0.2)
W <- rSparseWeightMatrix(nb.samp=n, nb.arch=K, sparse.coeff=0.7)
datList <- mixSubclones(subClones=datSubClone, W=W)
segData.TCN <- segmentData(datList, "TCN")
Y1 <- t(segData.TCN$Y)
Y <- list(Y1 = Y1)
Z0t.TCN <- initializeZt(Y1, K=K, flavor="nmf")
Zt <- list(Z1 = Z0t.TCN$Z1)
posFused <- positiveFusedLasso(Y, Zt, lambda=1e-3, verbose=TRUE)
modelFitStats(posFused)
segData.C1C2 <- segmentData(datList,"C1C2")
Y1 <- t(segData.C1C2$Y1)
Y2 <- t(segData.C1C2$Y2)
Y <- list(Y1 = Y1, Y2 = Y2)
Z0t.C1C2 <- initializeZt(Y1, Y2, K=K, flavor="nmf")
Zt <- list(Z1 = Z0t.C1C2$Z1, Z2 = Z0t.C1C2$Z2)
posFusedC <- positiveFusedLasso(Y, Zt, lambda=c(1e-3, 1e-3), verbose=TRUE)
print(posFusedC)
modelFitStats(posFusedC)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.