Description Usage Arguments Value Examples
View source: R/FastLORS_Functions.R
LORS_Screen_Parallel
LORS_Screen_Parallel
is a function used to run LORS-Screening on a subset of the columns of X. Can be used to perform LORS-Screening in parallel on a cluster.
1 | LORS_Screen_Parallel(Y, X, chunk)
|
Y |
gene expression matrix |
X |
matrix of SNPs |
chunk |
a group of columns to run the screening on. Done in batches of 1000. |
myB |
matrix of coefficients from LORS-Screening |
lambda |
tuning parameter used in LORS-Screening |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##Example
## Generate some data
n <- 20
p <- 50
q <- 30
k <- 4
set.seed(123)
X <- matrix(rbinom(n*p,1,0.5),n,p)
L <- matrix(rnorm(n*k),n,k) %*% t(matrix(rnorm(q*k),q,k))
B <- matrix(0, ncol(X), ncol(L))
activeSNPs <- sort(sample(c(1:nrow(B)), 20))
for(i in 1:length(activeSNPs)){
genes_influenced <- sort(sample(c(1:ncol(B)),5))
B[activeSNPs[i], genes_influenced] <- 2
}
E <- matrix(rnorm(n*q),n,q)
Y <- X %*% B + L + E
## Usage
LORS_Screen_Parallel(Y, X, chunk = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.