rm(list = ls())# convert from entrez ID to gene symbol #following instructions from: https://www.biostars.org/p/69647/#it is using a combination of the "annotate" package :https://www.bioconductor.org/packages/release/bioc/manuals/annotate/man/annotate.pdf#and "org.Hs.eg.db" package : https://bioconductor.org/packages/release/data/annotation/manuals/org.Hs.eg.db/man/org.Hs.eg.db.pdf
#if (!requireNamespace("BiocManager", quietly = TRUE)) #using r version 4 and higher # install.packages("BiocManager") #BiocManager::install("annotate")library(annotate)#BiocManager::install("org.Hs.eg.db")library(org.Hs.eg.db) name <- "GIANT_025_cutoff"#name <- "brain_top-1"dw <- "~/Documents/Nini/Brin/"setwd(dw)
interactome<- read.delim(paste0(dw, name), header=FALSE)df <- interactomenode1 <- as.character(df$V1)df$V1 <- getSYMBOL(node1, data='org.Hs.eg') #replace node 1 node2 <- as.character(df$V2)df$V2 <- getSYMBOL(node2, data='org.Hs.eg')write.table(df, paste0(dw,name,"_(gene_symbol_format)"), col.names=F, row.names = F,quote = F) #double check getSYMBOL(c('5498','8703','9507','4720'), data= 'org.Hs.eg')# should return "PPOX" "B4GALT3" "ADAMTS4" "NDUFS2" summary(is.na(node1)) #check conversion didn't produce any NAs summary(is.na(node2)) #check conversion didn't produce any NAs