positiveFusedLasso: Positive fused Lasso function

Description Usage Arguments Value Examples

View source: R/positiveFusedLasso.R

Description

Positive fused Lasso function

Usage

1
2
positiveFusedLasso(Y, Zt, lambda, intercept = FALSE, eps = 0.1,
  max.iter = 50L, warn = FALSE, verbose = FALSE)

Arguments

Y

A list of one or two matrices named Y1 and Y2 containing the segmented minor (and possibly the major) copy numbers (n patients in rows and J segments in columns).

Zt

A list of one or two J-by-K matrices names Z1 and Z2 containing the J minor (and possibly the major) copy numbers of the K initial latent feature estimates. Warning: These matrices are actually the transpose of Z1 and Z2, which is a notation mistake that will be fixed in a future release.

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 FALSE.

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 all(Z1 <= Z2) is not always satisfied? Defaults to FALSE.

verbose

If you want to print some information during running.

Value

An object of class posFused.

Examples

 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)

pneuvial/c3co documentation built on May 25, 2019, 10:21 a.m.