ReactomePA / Reactome: Extraction of genes within a term
1
0
Entering edit mode
@martinbusch-15897
Last seen 4.4 years ago

Hi all,

Currently I use the ReactomePA package for functional/athway analysis and I get a couple of significantly enriched terms in my data. However, I am wondering which particular genes from my data are represented in these terms - is there an elegant way to extract the gene ids/names of all genes in a reactome term? E.g. I find the term “M Phase” in my analysis with a low adjusted p value and a high gene ratio. Now I would like to know which genes of my input are part of that particular term and contributed to that result. Is there any way to extract these genes from the term? Any help is highly appreciated, thank you in advance for your help!

Best,

Martin

pathways reactomepa functional annotation • 2.5k views
ADD COMMENT
1
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 3 days ago
China/Guangzhou/Southern Medical Univer…

You can access such information using geneInCategory function.


> require(ReactomePA)
Loading required package: ReactomePA
ReactomePA v1.24.0  For help: https://guangchuangyu.github.io/ReactomePA

If you use ReactomePA in published research, please cite:
Guangchuang Yu, Qing-Yu He. ReactomePA: an R/Bioconductor package for reactome pathway analysis and visualization. Molecular BioSystems 2016, 12(2):477-479
> data(geneList, package="DOSE")
> x = enrichPathway(names(geneList)[1:100])
> x
#
# over-representation test
#
#...@organism      human
#...@ontology      Reactome
#...@keytype      ENTREZID
#...@gene      chr [1:100] "4312" "8318" "10874" "55143" "55388" "991" "6280" "2305" ...
#...pvalues adjusted by 'BH' with cutoff <0.05
#...73 enriched terms found
'data.frame':    73 obs. of  9 variables:
 $ ID         : chr  "R-HSA-68877" "R-HSA-69620" "R-HSA-2500257" "R-HSA-69618" ...
 $ Description: chr  "Mitotic Prometaphase" "Cell Cycle Checkpoints" "Resolution of Sister Chromatid Cohesion" "Mitotic Spindle Checkpoint" ...
 $ GeneRatio  : chr  "17/80" "19/80" "14/80" "13/80" ...
 $ BgRatio    : chr  "199/10561" "293/10561" "126/10561" "112/10561" ...
 $ pvalue     : num  8.59e-14 3.71e-13 4.41e-13 1.84e-12 5.70e-12 ...
 $ p.adjust   : num  2.10e-11 3.58e-11 3.58e-11 1.12e-10 2.32e-10 ...
 $ qvalue     : num  1.43e-11 2.44e-11 2.44e-11 7.63e-11 1.58e-10 ...
 $ geneID     : chr  "55143/991/1062/9133/10403/23397/220134/4751/79019/55839/983/54821/4085/81930/332/64151/9212" "8318/55143/55388/991/1062/9133/10403/11065/220134/79019/55839/890/983/54821/4085/81930/332/9212/1111" "55143/991/1062/9133/10403/220134/79019/55839/983/54821/4085/81930/332/9212" "55143/991/1062/10403/11065/220134/79019/55839/54821/4085/81930/332/9212" ...
 $ Count      : int  17 19 14 13 12 12 20 12 13 13 ...
#...Citation
  Guangchuang Yu, Qing-Yu He. ReactomePA: an R/Bioconductor package for
  reactome pathway analysis and visualization. Molecular BioSystems
  2016, 12(2):477-479

> geneInCategory(x)[["R-HSA-68877"]]
 [1] "55143"  "991"    "1062"   "9133"   "10403"  "23397"  "220134" "4751"
 [9] "79019"  "55839"  "983"    "54821"  "4085"   "81930"  "332"    "64151"
[17] "9212"

ADD COMMENT
0
Entering edit mode

Thank you for your swift reply, that works perfectly fine. Since I am quite new to R, I am a bit confused with the data format of

x

Using

geneInCategory(x)[]

I can extract all categories, but is it somehow possible to extract only a subset, e.g. those with p< 0.05 ? Thanks for your help!

ADD REPLY
1
Entering edit mode

> y = as.data.frame(x)
> ids = y$ID[y$p.adjust < 0.05]
> geneInCategory(x)[ids] %>% head(., 3)
$`R-HSA-68877`
 [1] "55143"  "991"    "1062"   "9133"   "10403"  "23397"  "220134" "4751"
 [9] "79019"  "55839"  "983"    "54821"  "4085"   "81930"  "332"    "64151"
[17] "9212"

$`R-HSA-69620`
 [1] "8318"   "55143"  "55388"  "991"    "1062"   "9133"   "10403"  "11065"
 [9] "220134" "79019"  "55839"  "890"    "983"    "54821"  "4085"   "81930"
[17] "332"    "9212"   "1111"

$`R-HSA-2500257`
 [1] "55143"  "991"    "1062"   "9133"   "10403"  "220134" "79019"  "55839"
 [9] "983"    "54821"  "4085"   "81930"  "332"    "9212"

ADD REPLY
0
Entering edit mode

Thanks a lot for your help!

ADD REPLY

Login before adding your answer.

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