Difference between revisions of "GGBsnippet.R"
From Organic Design wiki
m (note on 2*slides=p) |
(Make script functional and use IPTG-a parameters) |
||
Line 1: | Line 1: | ||
− | p <- 1000 | + | # p (genes) by n (slides) matrix |
− | n <- | + | # m=p keeping fdr notation |
− | a.shape <- | + | |
− | a0.shape <- | + | p <- m <- 1000 |
− | scale <- | + | nreps <- 5 |
+ | |||
+ | n <- nreps * 2 | ||
+ | pi0 <- 0.95 | ||
+ | |||
+ | m1 <- round(m * (1-pi0)) | ||
+ | m0 <- p - m1 | ||
+ | |||
+ | params <- c(2.74886, 1.36546, 4.12844) # "IPTG-a parameters" | ||
+ | |||
+ | a.shape <- params[1] | ||
+ | a0.shape <- params[2] | ||
+ | scale <- params[3] | ||
DEscales <- rgamma(2*m1, shape=a0.shape, rate=scale) | DEscales <- rgamma(2*m1, shape=a0.shape, rate=scale) | ||
EEscales <- rgamma(m0 , shape=a0.shape, rate=scale) | EEscales <- rgamma(m0 , shape=a0.shape, rate=scale) | ||
− | scales <- c(rep(DEscales, each= | + | scales <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps)) # same as p |
X <- rgamma(n* p, a.shape, rate=scales) | X <- rgamma(n* p, a.shape, rate=scales) | ||
− | dim(X) <- c(p | + | dim(X) <- c(n,p) |
+ | |||
X <- t(X) | X <- t(X) | ||
+ | |||
+ | pairs(log2(X)) |
Revision as of 23:36, 28 August 2006
- p (genes) by n (slides) matrix
- m=p keeping fdr notation
p <- m <- 1000 nreps <- 5
n <- nreps * 2 pi0 <- 0.95
m1 <- round(m * (1-pi0)) m0 <- p - m1
params <- c(2.74886, 1.36546, 4.12844) # "IPTG-a parameters"
a.shape <- params[1] a0.shape <- params[2] scale <- params[3]
DEscales <- rgamma(2*m1, shape=a0.shape, rate=scale) EEscales <- rgamma(m0 , shape=a0.shape, rate=scale)
scales <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps)) # same as p
X <- rgamma(n* p, a.shape, rate=scales) dim(X) <- c(n,p)
X <- t(X)
pairs(log2(X))