getToyData: Create a toy subclone and mixture data set

Description Usage Arguments Details Value Examples

View source: R/getToyData.R

Description

Create a toy subclone and mixture data set

Usage

1
2
getToyData(n, len, nbClones, nbSegs, eps, weightSparsity = 0.1,
  dimension = 1L, intercept = TRUE, returnLocus = TRUE)

Arguments

n

The number of observations.

len

The number of loci in each subclone.

nbClones

The number of subclones.

nbSegs

The total number of segments.

eps

A numeric value, the signal to noise ratio for simulated data.

weightSparsity

A numeric value in [0,1]: weights under weightSparsity are set to 0. This parameter controls the sparsity of the weight matrix.

dimension

An integer value in 1,2, the dimension of the signals to be generated (e.g. 1 for total copy numbers and 2 for minor and major copy numbers)

intercept

A logical value indicating whether an intercept should be added (this corresponds to the presence of a normal subclone).

returnLocus

A logical value indicating whether the locus-level data should be returned. Defaults to TRUE.

Details

For simplicity, the breakpoints positions are drawn uniformly from the set of all possible positions.

Value

W

A n-by-nbClones matrix of weights

segment

A list of two elements:

Y

An n-by-nbSegs matrix of observed CN signals if dimension==1, or a list of two such matrices if dimension==2

Z

An nbClones-by-nbSegs matrix of latent features (subclones)

if dimension==1, or a list of two such matrices if dimension==2

locus

only returned if returnLocus is TRUE: A list of two elements:

Y

An n-by-len matrix of observed CN signals, if dimension==1, or a list of two such matrices if dimension==2

Z

An nbClones-by-len matrix of latent features (subclones), if dimension==1, or a list of two such matrices if dimension==2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
len <- 100L     ## Number of loci
nbClones <- 3L  ## Number of subclones
nbSegs <- 6L    ## Number of segments
n <- 10L        ## Number of samples

dat <- getToyData(n, len, nbClones, nbSegs, eps = 0.0)  ## noiseless
matplot(t(dat$locus$Y), t = "s")
matplot(t(dat$segment$Y), t = "s")

dat <- getToyData(n, len, nbClones, nbSegs, eps = 0.2)  ## noisy
matplot(t(dat$locus$Y), t="s")
matplot(t(dat$segment$Y), t="s")


## Not run: 
l1 <- seq(from = 1e-6, to = 1e-4, length.out = 10L)
parameters.grid <- list(lambda = l1, nb.arch = 2:6)
Y <- dat$segment$Y
fit <- fitC3co(Y, parameters.grid=parameters.grid)
pvePlot2(fit$config$best)

## End(Not run)

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