las_bycgd: Multiple Copy Number Variation Detection

Description Usage Arguments References Examples

View source: R/las_bycgd.R

Description

Set up a model for multiple copy number variation detection with fused lasso and group lasso,the solve it using Block Coordinate Gradient Descent algorithm.

Usage

1
las_bycgd(Y, X = Y, lambda1 = 1, lambda2 =1)

Arguments

Y

A n*m matrix,in copy number variation detection problem,n denotes #(n) samples and m denotes #(m) probs.

X

A n*m matrix,the initial estimator of Y,with the same size of Y,often given X=Y.

lambda1

A real number larger than 0,the first penalty used in the model,controls the overall copy number alteration amount of the target chromosome.

lambda2

A real number larger than 0,the second penalty used in the model,controls the frequency of the alterations in the target region.

References

Paul Tseng and Sangwoon Yun(2009).A Coordinate Gradient Descent Method for Nonsmooth Separable Minimization. Math,117,387-423.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##simulated data:5 samples,980 probs.
sigma<-0.4;a<-0.5;i<-matrix(1:980,980,1);n<-5
J<-matrix(1:n,ncol=1)
g<-function(i) 0.25*sigma*sin(a*pi*i)
err<-function(i){
  set.seed(i);
  return(rnorm(980,0,sigma))
}
y<-matrix(,n,980);set.seed(123)
a1<-matrix(rnorm(n,0,1),n,300);
a2<-matrix(rnorm(n,0,1),n,380);
y[,1:300]<--0.2
y[,301:480]<-0.8
y[,481:980]<--0.2
y15<-y+t(apply(J,1,err))+apply(J,1,g)
rm(J,i,a,n,sigma,err,g,a1,a2,y)
beta15<-las_bycgd(y15)
plot(y15[1,],col=2,xlab="genome order",ylab="log2 ratio",
     main="n=15(the first sample)",ylim=c(-1.5,2))
lines(beta15[1,],col=4)

MultiCNVDetect documentation built on May 2, 2019, 2:49 p.m.