-
Notifications
You must be signed in to change notification settings - Fork 1
/
after_DE.R
18 lines (18 loc) · 908 Bytes
/
after_DE.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
kidney <- list.files(path = "C:/Users/xNesTea/python/project_sem_3/new_dir/data/liver/DE/")
liver <- list.files(path = "C:/Users/xNesTea/python/project_sem_3/new_dir/data/kidney/DE/")
fnames <- intersect(kidney, liver)
#fnames <- gsub("_piano.txt", "", files)
for(name in fnames){
setwd("C:/Users/xNesTea/python/project_sem_3/new_dir/data/kidney/DE/")
drug1 <- read.delim(paste(name))
setwd("C:/Users/xNesTea/python/project_sem_3/new_dir/data/liver/DE/")
drug2 <- read.delim(paste(name))
drug1$adj.P.Val[drug1$adj.P.Val>0.05] <- NaN
drug2$adj.P.Val[drug2$adj.P.Val>0.05] <- NaN
df <- merge(drug1, drug2, by = "X")
df <- df[complete.cases(df),]
df <- df[sign(df$logFC.x)==sign(df$logFC.y),]
setwd("C:/Users/xNesTea/python/project_sem_3/new_dir/data/common_de")
write.table(df, file = paste(name, "_intersect.txt", sep = ""), sep = "\t",col.names = NA)
print(dim(df))
}