fitC3co: c3co estimation from segment-level copy number data

Description Usage Arguments Value Examples

View source: R/fitC3co.R

Description

Estimate c3co model parameters from segment-level copy number data

Usage

1
2
fitC3co(Y1, Y2 = NULL, parameters.grid = NULL, warn = TRUE,
  intercept = FALSE, ..., verbose = FALSE)

Arguments

Y1, Y2

Numeric n-by-J matrices containing segment-level copy numbers, where n is the number of samples and J the number of segments. If Y2, which is optional, is specific, then (Y1,Y2) corresponds to minor and major copy numbers, otherwise (Y1) corresponds to total copy numbers.

parameters.grid

A list composed of two vectors named lambda1 and lambda2 of real numbers which are the penalty coefficients for the fused lasso on the minor and major copy number dimension and a vector named nb.arch of integers which is the number of archetypes in the model.

warn

If TRUE and Y1 is specified, then a warning is produced if Z1 <= Z2 is not satisfied for a candidate number of subclones.

intercept

logical: should an intercept be included in the model? Defaults to FALSE.

...

Further arguments to be passed to initializeZt().

verbose

A logical indicating whether to print extra information. Defaults to FALSE.

Value

A list of k objects of class c3coFit, where k is the number of candidate number of subclones.

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
35
36
37
38
39
40
41
## Simulate locus-level (C1,C2) copy-number data
set.seed(7)
dataAnnotTP <- acnr::loadCnRegionData(dataSet="GSE11976", tumorFrac=1)
dataAnnotN <- acnr::loadCnRegionData(dataSet="GSE11976", tumorFrac=0)
len <- 500*10  ## Number of loci
K <- 3L        ## Number of subclones
n <- 14L       ## Number of samples
bkps <- list(c(100, 250)*10, c(150, 400)*10, c(150, 400)*10)
regions <- list(c("(0,3)", "(0,2)", "(1,2)"),
c("(1,1)", "(0,1)", "(1,1)"), c("(0,2)", "(0,1)", "(1,1)"))
datSubClone <- buildSubclones(len, K, bkps, regions, dataAnnotTP, dataAnnotN)
W <- rSparseWeightMatrix(nb.samp=n, nb.arch=K, sparse.coeff=0.7)
dat <- mixSubclones(subClones=datSubClone, W=W)

## Segment the copy-number data
seg <- segmentData(dat)

## Fit C3CO model
l1 <- seq(from=1e-8, to=1e-5, length.out=5L)
parameters.grid <- list(lambda1=l1, nb.arch=1:3)
fitList <- fitC3co(t(seg$Y1), t(seg$Y2), parameters.grid=parameters.grid)
## FIXME (cf Issue #67):
## fitListC <- fitC3co(t(seg$Y), parameters.grid=parameters.grid) 


## A simpler example with toy data
K <- 3L   ## Number of subclones
J <- 6L   ## Number of segments
n <- 20L  ## Number of samples

l1 <- 1e-4
candP <- 2:J
parameters.grid <- list(lambda=l1, nb.arch=candP)

dat <- getToyData(n=n, len=100L, nbClones=K, nbSegs=J, eps=0.2)  ## almost noiseless!
sdat <- dat$segment

res <- fitC3co(sdat$Y, parameters.grid=parameters.grid)
pvePlot2(res$config$best, ylim=c(0.6, 1))
mus <- sapply(res$fit, FUN=function(x) x@mu)
## the mus are all identical??

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