dat1 <- data.frame(matrix(rnorm(10000),ncol=10,nrow=1000))
rownames(dat1) <- paste("g", 1:1000, sep="")
colnames(dat1) <- paste("s", 1:10, sep="")
dat2 <- data.frame(matrix(rnorm(10000),ncol=10,nrow=1000))
rownames(dat2) <- paste("g", 1:1000, sep="")
colnames(dat2) <- paste("s", 1:10, sep="")
## run ICA
resJade1 <- runICA(X=dat1, nbComp=3, method = "JADE")
resJade2 <- runICA(X=dat2, nbComp=3, method = "JADE")
## build params
params <- buildMineICAParams(resPath="toy/")
## build IcaSet objects
icaSettoy1 <- buildIcaSet(params=params, A=data.frame(resJade1$A), S=data.frame(resJade1$S),
dat=dat1, alreadyAnnot=TRUE)$icaSet
icaSettoy2 <- buildIcaSet(params=params, A=data.frame(resJade2$A), S=data.frame(resJade2$S),
dat=dat2, alreadyAnnot=TRUE)$icaSet
## compare IcaSet objects
## use tkplot=TRUE to get an interactive graph
rescomp <- runCompareIcaSets(icaSets=list(icaSettoy1, icaSettoy2), labAn=c("toy1","toy2"),
type.corr="pearson", level="genes", tkplot=FALSE)
## Not run:
# ## load the microarray-based gene expression datasets
# ## of breast tumors
# library(breastCancerMAINZ)
# library(breastCancerVDX)
# data(mainz)
# data(vdx)
#
# ## Define a function used to build two examples of IcaSet objects
# ## and annotate the probe sets into gene Symbols
# treat <- function(es, annot="hgu133a.db") {
# es <- selectFeatures_IQR(es,10000)
# exprs(es) <- t(apply(exprs(es),1,scale,scale=FALSE))
# colnames(exprs(es)) <- sampleNames(es)
# resJade <- runICA(X=exprs(es), nbComp=10, method = "JADE", maxit=10000)
# resBuild <- buildIcaSet(params=buildMineICAParams(), A=data.frame(resJade$A), S=data.frame(resJade$S),
# dat=exprs(es), pData=pData(es), refSamples=character(0),
# annotation=annot, typeID= typeIDmainz,
# chipManu = "affymetrix", mart=mart)
# icaSet <- resBuild$icaSet
# }
# ## Build the two IcaSet objects
# icaSetMainz <- treat(mainz)
# icaSetVdx <- treat(vdx)
#
# ## compare the IcaSets
# runCompareIcaSets(icaSets=list(icaSetMainz, icaSetVdx), labAn=c("Mainz","Vdx"), type.corr="pearson", level="genes")
# ## End(Not run)
Run the code above in your browser using DataLab