How do we get genes involved in all immune system pathways?
1
0
Entering edit mode
Recep • 0
@7c8fd686
Last seen 10 weeks ago
Germany

Hi guys,

im new in bioinformatics. Im researching the interaction between microbiota and immunity.

I want to get all the genes, which play role a role in the immune system.

Here you can see all pathways related to immune system

Manually i can find genes in each pathway, but there are lots of pathways. So i want to make it short.

If you have any advice, i would be grateful.

Best

keggorthology KEGG • 260 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 7 hours ago
United States

There's probably a more sophisticated way to do this, but here's a semi-brute force way, using KEGG's REST API.

> gnmap <- read.table("https://rest.kegg.jp/link/hsa/pathway/", sep = "\t")
> names(gnmap) <- c("Path","GeneID")
## Woo brute force
> whatIwant <- c(paste0("path:hsa046", c(40,10,11,13,20,24,21,22,23,25,60,12,60,58,59,57,62,64,66,70,72)), "path:hsa04062")
> gnmap2 <- subset(gnmap, Path %in% whatIwant)
> library(org.Hs.eg.db)
> gnmap2$Symbol <- mapIds(org.Hs.eg.db, gsub("hsa:", "", gnmap2$GeneID), "SYMBOL", "ENTREZID")
'select()' returned 1:1 mapping between keys and columns
> head(gnmap2)
              Path    GeneID  Symbol
8506 path:hsa04062 hsa:10000    AKT3
8507 path:hsa04062 hsa:10235 RASGRP2
8508 path:hsa04062 hsa:10344   CCL26
8509 path:hsa04062 hsa:10451    VAV3
8510 path:hsa04062 hsa:10563  CXCL13
8511 path:hsa04062 hsa:10663   CXCR6

## Or maybe clean that up a bit.

> gnmap2$Path <- gsub("path:", "", gnmap2$Path)
> gnmap2$GeneID <-  gsub("hsa:", "", gnmap2$GeneID)
> head(gnmap2)
         Path GeneID  Symbol
8506 hsa04062  10000    AKT3
8507 hsa04062  10235 RASGRP2
8508 hsa04062  10344   CCL26
8509 hsa04062  10451    VAV3
8510 hsa04062  10563  CXCL13
8511 hsa04062  10663   CXCR6
0
Entering edit mode

James' answer is great. Just for completeness, the limma package has two helper functions that might be helpful:

library(limma)

# get gene identifiers (= Entrez ids) & pathway ids 
genes <- getGeneKEGGLinks(species.KEGG = "hsa", convert = TRUE)

# get description for each pathway
pathways <- getKEGGPathwayNames(species.KEGG = "hsa", remove.qualifier = TRUE)

head(genes)
  GeneID     PathwayID
1  10327 path:hsa00010
2    124 path:hsa00010
3    125 path:hsa00010
4    126 path:hsa00010
5    127 path:hsa00010
6    128 path:hsa00010

> head(pathways)
      PathwayID                              Description
1 path:hsa00010             Glycolysis / Gluconeogenesis
2 path:hsa00020                Citrate cycle (TCA cycle)
3 path:hsa00030                Pentose phosphate pathway
4 path:hsa00040 Pentose and glucuronate interconversions
5 path:hsa00051          Fructose and mannose metabolism
6 path:hsa00052                     Galactose metabolism

pws <- split(genes$GeneID, genes$PathwayID)
names(pws) <- pathways[match(names(pws), pathways$PathwayID), "Description"]
pws[1]

> pws[1]
$`Glycolysis / Gluconeogenesis`
 [1] "10327"  "124"    "125"    "126"    "127"    "128"    "130"   
 [8] "130589" "131"    "160287" "1737"   "1738"   "2023"   "2026"  
[15] "2027"   "217"    "218"    "219"    "2203"   "221"    "222"   
[22] "223"    "224"    "226"    "229"    "230"    "2538"   "2597"  
[29] "26330"  "2645"   "2821"   "3098"   "3099"   "3101"   "387712"
[36] "3939"   "3945"   "3948"   "441531" "501"    "5105"   "5106"  
[43] "5160"   "5161"   "5162"   "5211"   "5213"   "5214"   "5223"  
[50] "5224"   "5230"   "5232"   "5236"   "5313"   "5315"   "55276" 
[57] "55902"  "57818"  "669"    "7167"   "80201"  "83440"  "84532" 
[64] "8789"   "92483"  "92579"  "9562"
ADD REPLY

Login before adding your answer.

Traffic: 380 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