Commit 0b5dafa3 authored by Sayed Rzgar Hosseini's avatar Sayed Rzgar Hosseini
Browse files

Upload New File

parent 1c86fd1a
######################################################################################################################################################################################################
anchor_breast<-read.csv("./Tables/Table10.csv")$Gene
anchor_colorectal<-read.csv("./Tables/Table11.csv")$Gene
Candidate_Breast<-read.csv("./Tables/Table8.csv")$x
Candidate_Colorectal<-read.csv("./Tables/Table9.csv")$x
######################################################################################################################################################################################################
# In this section, we identify the set of compounds that target at least one of the anchor genes
U1<-c("P31749","P10275","O14497","Q8NFD5","Q13315","Q13535","Q99728","P10415","Q07817","P38398","P51587","O60885","Q9NYV4","P11802","Q00534","P50613","O14757","O96017","P26358","Q9UBC3","Q15910","P11362","P21802","O94925","O14686","Q07820","P42345","P01106","P09874","P42336","P42338","Q99873","O14744","Q06124","O60216","Q06609","P04049","Q16635","P46937","P30291") #UniProt IDs of the Breast Anchor genes
U2<-c("P31749","P31751","P25054","O14497","Q13315","Q13535","O14965","P10415","Q07817","P15056","O60885","P11802","Q00534","P49336","O14757","P35222","P26358","Q9UBC3","Q504U8","P04626","P08069","P23458","P01116","Q02750","P36507","P28482","Q07820","Q00987","P01106","P09874","P42336","Q9H237","Q99873","O14744","Q06124","P04049","Q13485","P12931","Q16635","P15692","P30291","Q14191","P46937") #UniProt IDs of the Colorectal Anchor genes
E1<-numeric(40)
E2<-numeric(43)
library(org.Hs.eg.db)
for (i in 1:40){E1[i]<-as.numeric(select(org.Hs.eg.db,keys = U1[i],columns = c("ENTREZID", "UNIPROT"),keytype = "UNIPROT")$ENTREZID)}
for (i in 1:43){E2[i]<-as.numeric(select(org.Hs.eg.db,keys = U2[i],columns = c("ENTREZID", "UNIPROT"),keytype = "UNIPROT")$ENTREZID)}
ChEMBL<-read.csv("./Tables/Table22.csv")
Pert<-as.character(read.table("./SupplementaryData/SupplementaryData1/CompoundID1.txt")$V1)
CID<-read.table("./SupplementaryData/SupplementaryData1/CompoundID2.txt")$V1
U<-unique(intersect(ChEMBL$cid,CID))
S1<-numeric(length(U))
S2<-numeric(length(U))
for (i in 1:length(U)){
S1[i]<-length(intersect(ChEMBL$ENTREZID[which(ChEMBL$cid==U[i])],E1))
S2[i]<-length(intersect(ChEMBL$ENTREZID[which(ChEMBL$cid==U[i])],E2))
}
Selected_CID1<-as.numeric(U[which(S1>0)])
Selected_CID2<-as.numeric(U[which(S2>0)])
Selected_Pert1<-numeric(length(Selected_CID1))
Selected_Pert2<-numeric(length(Selected_CID2))
for (i in 1:length(Selected_CID1)){Selected_Pert1[i]<-unique(Pert[which(CID==Selected_CID1[i])])}
for (i in 1:length(Selected_CID2)){Selected_Pert2[i]<-unique(Pert[which(CID==Selected_CID2[i])])}
MCF7<-read.csv("./SupplementaryData/SupplementaryData1/MCF7/MCF7_6h_10uM_LM.csv")# CMAP Raw data (MCF7)
HT29<-read.csv("./SupplementaryData/SupplementaryData1/HT29/LM/HT29_6h_10uM.csv")# CMAP Raw data (HT29)
Compounds1<-intersect(colnames(MCF7),Selected_Pert1)
Compounds2<-intersect(colnames(HT29),Selected_Pert2)
Cindex1<-numeric(length(Compounds1))
Cindex2<-numeric(length(Compounds2))
for (i in 1:length(Compounds1)){Cindex1[i]<-which(colnames(MCF7)==Compounds1[i])}
for (i in 1:length(Compounds2)){Cindex2[i]<-which(colnames(HT29)==Compounds2[i])}
save(Compounds2,file="./Tables/Table21.csv")
write.csv(Compounds1, "./Tables/Table20.csv", append = FALSE, sep = " ", dec = ".",row.names = TRUE, col.names = TRUE)
write.csv(Compounds2, "./Tables/Table21.csv", append = FALSE, sep = " ", dec = ".",row.names = TRUE, col.names = TRUE)
######################################################################################################################################################################################################
######################################################################################################################################################################################################
### Reading Files:
resultsB1<-list()
resultsB2<-list()
for (i in 1:70){
resultsB1[[i]]<-read.table(paste0("./SupplementaryData/SupplementaryData1/MCF7/ALL/CARNIVAL/",Compounds1[i],"/results.txt"))# ALL: using CMAP data including the inferred genes
resultsB2[[i]]<-read.table(paste0("./SupplementaryData/SupplementaryData1/MCF7/LM/CARNIVAL/",Compounds1[i],"/results.txt"))# LM: using CMAP data including only the landmark genes
}
resultsC1<-list()
resultsC2<-list()
for (i in 1:53){
resultsC1[[i]]<-read.table(paste0("./SupplementaryData/SupplementaryData1/HT29/ALL/CARNIVAL/",Compounds2[i],"/results.txt"))
resultsC2[[i]]<-read.table(paste0("./SupplementaryData/SupplementaryData1/HT29/LM/CARNIVAL/",Compounds2[i],"/results.txt"))
}
geneSetB1<-c()
geneSetB2<-c()
for (i in 1:70){geneSetB1<-c(geneSetB1,resultsB1[[i]]$V1[intersect(which(resultsB1[[i]]$V5>=100),which(resultsB1[[i]]$V3==resultsB1[[i]]$V5))])}
for (i in 1:70){geneSetB2<-c(geneSetB2,resultsB2[[i]]$V1[intersect(which(resultsB2[[i]]$V5>=100),which(resultsB2[[i]]$V3==resultsB2[[i]]$V5))])}
intersect(unique(geneSetB1),unique(geneSetB2))
geneSetC1<-c()
geneSetC2<-c()
for (i in 1:53){geneSetC1<-c(geneSetC1,resultsC1[[i]]$V1[intersect(which(resultsC1[[i]]$V5>=100),which(resultsC1[[i]]$V3==resultsC1[[i]]$V5))])}
for (i in 1:53){geneSetC2<-c(geneSetC2,resultsC2[[i]]$V1[intersect(which(resultsC2[[i]]$V5>=100),which(resultsC2[[i]]$V3==resultsC2[[i]]$V5))])}
intersect(unique(geneSetC1),unique(geneSetC2))
UgeneSetB1<-unique(geneSetB1)
UgeneSetB2<-unique(geneSetB2)
UgeneSetC1<-unique(geneSetC1)
UgeneSetC2<-unique(geneSetC2)
######################################################################################################################################################################################################
######################################################################################################################################################################################################
Symbol_B1<-character(length(UgeneSetB1))
Symbol_B2<-character(length(UgeneSetB2))
Symbol_C1<-character(length(UgeneSetC1))
Symbol_C2<-character(length(UgeneSetC2))
library(org.Hs.eg.db)
for (i in 1:length(UgeneSetB1)){try(Symbol_B1[i]<-select(org.Hs.eg.db,keys = as.character(UgeneSetB1[i]),columns = c("SYMBOL", "UNIPROT"),keytype = "UNIPROT")$SYMBOL);print(paste(1,i))}
for (i in 1:length(UgeneSetB2)){try(Symbol_B2[i]<-select(org.Hs.eg.db,keys = as.character(UgeneSetB2[i]),columns = c("SYMBOL", "UNIPROT"),keytype = "UNIPROT")$SYMBOL);print(paste(2,i))}
for (i in 1:length(UgeneSetC1)){try(Symbol_C1[i]<-select(org.Hs.eg.db,keys = as.character(UgeneSetC1[i]),columns = c("SYMBOL", "UNIPROT"),keytype = "UNIPROT")$SYMBOL);print(paste(3,i))}
for (i in 1:length(UgeneSetC2)){try(Symbol_C2[i]<-select(org.Hs.eg.db,keys = as.character(UgeneSetC2[i]),columns = c("SYMBOL", "UNIPROT"),keytype = "UNIPROT")$SYMBOL);print(paste(4,i))}
Symbol_B1<-setdiff(Symbol_B1,"")
Symbol_B2<-setdiff(Symbol_B2,"")
Symbol_C1<-setdiff(Symbol_C1,"")
Symbol_C2<-setdiff(Symbol_C2,"")
CARNIVAL_candidates_Breast<-union(Symbol_B1,Symbol_B2)
CARNIVAL_candidates_Colorectal<-union(Symbol_C1,Symbol_C2)
CARNIVAL_Breast<-intersect(CARNIVAL_candidates_Breast,Candidate_Breast)
CARNIVAL_Colorectal<-intersect(CARNIVAL_candidates_Colorectal,Candidate_Colorectal)
######################################################################################################################################################################################################
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment