StringDB get enrichment KEGG
1
0
Entering edit mode
6.0 years ago
Pin.Bioinf ▴ 340

Hello,

I do my enrichment from a list of genes using stringdb. package. It returns the pathways , the pvalue and the number of hits per pathway. How can I get which genes were mapped to each pathway? I could not find a way by looking at the stringdb manual.

This is my function:

library(STRINGdb)

##Open connection with database STRING and obtain a network as an igraph object with a threshold >400.
string_db <- STRINGdb$new( version="10", species=9606, score_threshold=400, input_directory="" )
string.network <- string_db$get_graph() 
  proteins <- string_db$get_proteins()
        p <- dplyr::select(proteins, preferred_name)
        proteins <- string_db$map(p, "preferred_name")

EnrichmentKegg<-function(list){     
        nodes.string <- (filter(proteins, preferred_name %in% list))$STRING_id
        res<-string_db$get_enrichment( nodes.string, category = "KEGG", methodMT = "fdr", iea = TRUE )

        if(nrow(res)>10){
               tst<-as.data.frame(res[1:10,])
         }else{
               tst<-as.data.frame(res)
          }
   print(tst)
}
kegg enrichment R • 3.3k views
ADD COMMENT
1
Entering edit mode
4.7 years ago
gragedaa ▴ 10

Hey! I came across the same problem and found that you can use string_db$get_annotations() and string_db$get_aliases in order to find which STRING_ids map to which term_id, and then convert the STRING_ids into the conventional protein name. I use dplyr to mess around with the tables, but I'm sure any method would work.

ADD COMMENT

Login before adding your answer.

Traffic: 2584 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6