testCor.R
##test out my correlation function
library(ALL) data(ALL)
##GET BCR/ABL and NEG Bsub = grep("^B", as.character(ALL$BT)) Bcr = grep("^BCR", as.character(ALL$mol)) Bneg = grep("NEG", as.character(ALL$mol))
ALLs = ALL[, c(Bcr, intersect(Bsub, Bneg))]
##DROP unexpressed genes library(genefilter)
pF = pOverA(.25, 7)
whF = genefilter(ALLs, filterfun(pF))
ALLs2 = ALLs[whF,]
##find pairs library(hgu95av2)
lls = unlist(as.list(hgu95av2LOCUSID))
tab = table(lls)
data(hgu95av2LOCUSID2PROBE)
lp = as.list(hgu95av2LOCUSID2PROBE)
cts = listLen(lp)
have2 = cts==2
lp2 = lp[have2]
gN2 = geneNames(ALLs2)
haveBoth = sapply(lp2, function(x) if(all(!is.na(match(x, gN2))) ) TRUE else FALSE)
lp3 = lp2[haveBoth]
exprs2 = exprs(ALLs2)
##at least in this setting nothing good came of this
aa1 = sapply(lp3, function(x) cor(exprs2[x[1],], exprs2[x[2],]) )
aa2 = sapply(lp3, function(x) percentCor(exprs2[x[1],], exprs2[x[2],]))
aa3 = sapply(lp3, function(x) percentCor(exprs2[x[1],], exprs2[x[2],], 50))
aa4 = sapply(lp3, function(x) percentCor(exprs2[x[1],], exprs2[x[2],], method="spearman"))