-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.R
executable file
·37 lines (25 loc) · 1.25 KB
/
test.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
#### load data #########
source("R/source.R")
pr <- read.table("testdata/all.KEGG.abun.txt",row.names = 1,header = T,sep = "\t")
grp <- read.table("testdata/sampleinfo.txt",row.names = 1,header = T,sep = "\t")
#### D2
grp_sub <- grp[which(grp$TimePoint == "Day2"), 1, drop=F]
grp_sub$Protein <- ifelse(grp_sub$Protein == "C-Pork",
"B-Beef", grp_sub$Protein)
pr_sub <- pr[, rownames(grp_sub)]
res_D2 <- ReporterScore(pr_sub, grp_sub, paired = F, database = "./database", occ = 0.1)
fig <- ReportVis(res_D2, color = c("#2470a0", "#DE3C3C"), exclude = T)
dir.create("fig")
ggsave("fig/test.pdf", fig, device = "pdf", height = 12, width = 15)
#### D7
grp_sub <- grp[which(grp$TimePoint == "Day7"), 1, drop=F]
grp_sub$Protein <- ifelse(grp_sub$Protein == "C-Pork",
"B-Beef", grp_sub$Protein)
pr_sub <- pr[, rownames(grp_sub)]
res_D7 <- ReporterScore(pr_sub, grp_sub, paired = F, database = "./database", occ = 0.1)
#### D14
grp_sub <- grp[which(grp$TimePoint == "Day14"), 1, drop=F]
grp_sub$Protein <- ifelse(grp_sub$Protein == "C-Pork",
"B-Beef", grp_sub$Protein)
pr_sub <- pr[, rownames(grp_sub)]
res_D14 <- ReporterScore(pr_sub, grp_sub, paired = F, database = "./database", occ = 0.1)