Question: StringDB get enrichment KEGG
0
gravatar for Pin.Bioinf
20 months ago by
Pin.Bioinf260
Malaga
Pin.Bioinf260 wrote:

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)
}
R kegg enrichment • 932 views
ADD COMMENTlink modified 4 months ago by gragedaa0 • written 20 months ago by Pin.Bioinf260
0
gravatar for gragedaa
4 months ago by
gragedaa0
gragedaa0 wrote:

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 COMMENTlink written 4 months ago by gragedaa0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1524 users visited in the last hour