-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwrapper3.R
More file actions
59 lines (41 loc) · 2.58 KB
/
wrapper3.R
File metadata and controls
59 lines (41 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function (dataf, list11Rdata)
{
beta = dataf@bmatrix
groupinfo = dataf@groupinfo
list11 = c("TSS1500Ind", "GENEBODYInd", "ISLANDInd")
gcase="T"
gcontrol=c("N","AN")
paired=FALSE
testmethod="limma"
Padj="BH"
concov = "OFF"
rawpcut = 0.01
adjustpcut = 0.01
annot.df = as.data.frame(dataf@annot)
indexTSS1500 = which(grepl("TSS1500",annot.df[,"UCSC_REFGENE_GROUP"]))
indexGENEBODY = which(grepl("Body",annot.df[,"UCSC_REFGENE_GROUP"]))
indexISLAND = which(grepl("Island",annot.df[,"RELATION_TO_UCSC_CPG_ISLAND"]))
indexISLANDu = indexISLAND[!indexISLAND[] %in% indexGENEBODY[]]
indexISLANDu = indexISLANDu[!indexISLANDu[] %in% indexTSS1500[]]
indexGENEBODYu = indexGENEBODY[!indexGENEBODY[] %in% indexTSS1500[]]
indexGENEBODYu = indexGENEBODYu[!indexGENEBODYu[] %in% indexISLAND[]]
indexTSS1500u = indexTSS1500[!indexTSS1500[] %in% indexGENEBODY[]]
indexTSS1500u = indexTSS1500u[!indexTSS1500u[] %in% indexISLAND[]]
indexlistTSS1500 = dataf@TSS1500Ind
eset = indexregionfunc2(indexlistTSS1500, indexTSS1500u, beta, "mean")
TSS1500Indtest = as.data.frame(testfunc2(eset,concov=concov,testmethod=testmethod,Padj=Padj,groupinfo = groupinfo,paired = paired,gcase = gcase,gcontrol = gcontrol))
TSS1500Indtest=TSS1500Indtest[!is.na(TSS1500Indtest[,3]),]
TSS1500Indtest=outputDMfunc(TSS1500Indtest,rawpcut = rawpcut,adjustpcut = adjustpcut,betadiffcut = betadiffcut)
indexlistGENEBODY = dataf@GENEBODYInd
eset = indexregionfunc2(indexlistGENEBODY,indexGENEBODYu, beta, "mean")
GENEBODYIndtest = as.data.frame(testfunc2(eset,concov=concov,testmethod=testmethod,Padj=Padj,groupinfo = groupinfo,paired = paired,gcase = gcase,gcontrol = gcontrol))
GENEBODYIndtest=GENEBODYIndtest[!is.na(GENEBODYIndtest[,3]),]
GENEBODYIndtest=outputDMfunc(GENEBODYIndtest,rawpcut = rawpcut,adjustpcut = adjustpcut,betadiffcut = betadiffcut)
indexlistISLAND = dataf@ISLANDInd
eset = indexregionfunc2(indexlistISLAND,indexISLANDu, beta, "mean")
ISLANDIndtest = as.data.frame(testfunc2(eset,concov=concov,testmethod=testmethod,Padj=Padj,groupinfo = groupinfo,paired = paired,gcase = gcase,gcontrol = gcontrol))
ISLANDIndtest=ISLANDIndtest[!is.na(ISLANDIndtest[,3]),]
ISLANDIndtest=outputDMfunc(ISLANDIndtest,rawpcut = rawpcut,adjustpcut = adjustpcut,betadiffcut = betadiffcut)
eval(parse(text = paste("save(", paste(paste(list11, "test",
sep = ""), collapse = ","), ",file = list11Rdata)", sep = "")))
}