Difference between revisions of "GGB-correlation-snippet.R"
From Organic Design wiki
(More diagnostic plots and increased k (more realistic)) |
m (fix k param) |
||
Line 2: | Line 2: | ||
# m=p keeping fdr notation | # m=p keeping fdr notation | ||
− | m <- p <- 1000 | + | m <- p <- 1000 |
nreps <- 5 | nreps <- 5 | ||
Line 12: | Line 12: | ||
params <- c(2.74886, 1.36546, 4.12844) # "IPTG-a parameters" | params <- c(2.74886, 1.36546, 4.12844) # "IPTG-a parameters" | ||
− | k <- | + | k <- 100 |
a.shape <- params[1] | a.shape <- params[1] | ||
Line 22: | Line 22: | ||
plot(density(kDE)) | plot(density(kDE)) | ||
DEscales <- rgamma(2*m1, shape=a0.shape, rate=scale) | DEscales <- rgamma(2*m1, shape=a0.shape, rate=scale) | ||
− | DEscales <- DEscales * | + | DEscales <- DEscales * kDE |
kEE <- rgamma(m0, shape=k, rate=k) | kEE <- rgamma(m0, shape=k, rate=k) | ||
Line 28: | Line 28: | ||
plot(density(kEE)) | plot(density(kEE)) | ||
EEscales <- rgamma(m0 , shape=a0.shape, rate=scale) | EEscales <- rgamma(m0 , shape=a0.shape, rate=scale) | ||
− | EEscales <- EEscales / | + | EEscales <- EEscales / kEE |
scales <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps)) | scales <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps)) |
Revision as of 23:54, 28 August 2006
- p (genes) by n (slides) matrix
- m=p keeping fdr notation
m <- p <- 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" k <- 100
a.shape <- params[1] a0.shape <- params[2] scale <- params[3]
kDE <- rgamma(2*m1, shape=k, rate=k) # p49 2001 NEWTON paper plot(kDE) plot(density(kDE)) DEscales <- rgamma(2*m1, shape=a0.shape, rate=scale) DEscales <- DEscales * kDE
kEE <- rgamma(m0, shape=k, rate=k) plot(kEE) plot(density(kEE)) EEscales <- rgamma(m0 , shape=a0.shape, rate=scale) EEscales <- EEscales / kEE
scales <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps)) X <- rgamma(n* p, a.shape, rate=scales) dim(X) <- c(n,p)
X <- t(X)
- Graphical check
pairs(log2(X)) hist(rowMeans(log2(X)), breaks=30)