-
Notifications
You must be signed in to change notification settings - Fork 1
/
analysis.3.Salmon_Seaage_polysel.R
62 lines (48 loc) · 1.94 KB
/
analysis.3.Salmon_Seaage_polysel.R
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
60
61
setwd("~/Desktop/Software/polysel/")
# set project variables
project.name<-"salmon_MQN_PC1"
data.path<-file.path("./data/salmon_FQN_PC1/")
code.path<-"./R"
empfdr.path<-"./empfdr"
results.path<-"./results"
source(file.path(code.path,'polysel.R'))
minsetsize<-5
result<-ReadSetObjTables(in.path=data.path,
set.info.file="SetInfo.txt",
set.obj.file="SetObj.txt",
obj.info.file="ObjInfo.txt",
minsetsize=minsetsize,
obj.in.set=F,
merge.similar.sets=T)
set.info<-result$set.info
obj.info<-result$obj.info
set.obj<-result$set.obj
set.info.lnk<-result$set.info.lnk
cat("Number of sets: ", nrow(set.info), "\n", sep="")
cat("Number of genes: ", nrow(obj.info), "\n", sep="")
print(set.info[1:5,],row.names=F, right=F)
print(obj.info[1:5,],row.names=F, right=F)
print(set.obj[1:5,],row.names=F, right=F)
for (sz in c(10,50,250)){
CheckStatDistribution(obj.info,setsize=sz,
n.rand = 100000,
xlab="sum(objStat)")
}
obj.stat<-obj.info[,c("objID", "objStat", "objBin")]
approx.null <- TRUE
use.bins <- FALSE
seq.rnd.sampling <- FALSE
nrand <- 1
test <- "highertail"
qvalue.method <- "smoother"
result<-EnrichmentAnalysis(set.info, set.obj, obj.stat,
nrand=nrand, approx.null=approx.null,
seq.rnd.sampling=seq.rnd.sampling,
use.bins=use.bins, test=test,
do.pruning=FALSE, minsetsize=minsetsize,
project.txt=project.name, do.emp.fdr=FALSE,
qvalue.method=qvalue.method
)
set.scores.prepruning <- result$set.scores.prepruning
print(set.scores.prepruning[1:10,],row.names=F, right=F)
write.table(set.scores.prepruning, "~/Desktop/Working/Sea_Age/salmon_MQN_PC1_polysel.txt", col.names = T, row.names = F, sep = "\t", quote = F)