Tim Triche, Jr.
November 21st, 2013
require(GEOquery)
#require(genefilter)
#require(hgu133plus2.db)
#agingHSCs <- getGEO('GSE32719')[[1]]
#agingHSCs$agegroup <- relevel(factor(agingHSCs$source_name_ch1), 3)
#annotation(agingHSCs) <- 'hgu133plus2'
#aging <- nsFilter(agingHSCs)$eset
theFile <- url("http://www.anamnetic.com/JGL/agingHSCs.rds")
aging <- readRDS(theFile)
close(theFile)
byAgeGroup <- split.data.frame(t(exprs(aging)), aging$agegroup)
require(JGL)
lambda1 <- 0.99
lambda2 <- 0.01
# running the next step seems to take
# upwards of an hour on a box with 48GB RAM
# solution <- JGL(byAgeGroup, 'fused', lambda1, lambda2, weights='sample.size')
# cool! It worked! (slowly)
require(glasso)
# sigmaHat <- cov(t(exprs(aging))) * ((ncol(aging)-1)/ncol(aging))
# soln.glasso <- glasso(sigmaHat, rho=lambda1, penalize.diagonal=FALSE)
# inspect the glasso solution:
require(JGL)
theOtherFile <- url("http://www.anamnetic.com/JGL/JGL.soln.rds", open="r")
solution <- readRDS(theOtherFile)
close(theOtherFile)
plot(solution) # kinda slow
# all entries in theta have same size...
features <- intersect(rownames(solution$theta[[1]]), colnames(solution$theta[[1]]))
aging2 <- t(exprs(aging)[features,])
byAgeGroup2 <- split.data.frame(t(exprs(aging)[features,]), aging$agegroup)
unlist(lapply(byAgeGroup2, nrow)) ## subjects
Young HSC Middle HSC Old HSC
14 5 8
unlist(lapply(byAgeGroup2, ncol)) ## features
Young HSC Middle HSC Old HSC
1677 1677 1677
# solution.shrunkMore <- JGL(Y=byAgeGroup2, lambda1=0.999, lambda2=0.1,
# warm=solution$theta, weights='sample.size')
# starting ADMM
# Error in while ((iter == 0) || (iter < maxiter && diff_value > tol)) { :
# missing value where TRUE/FALSE needed
Oops
At the moment, until I feed an MLE for the overall covariance matrix to glasso() and shrink out substantial numbers of edges, I can't claim to be Doing It Right… but the results so far are already somewhat promising and I hope to resolve this soon.