working with .gmt files
3
Hi!
I have downloaded a pathway data set in .gmt format form the GSEA website.
I'm wondering how can I properly read this data set in R.
Could anyone help me?
Thank you!
gsea
R
• 20k views
•
link
updated 3.2 years ago by
Ram
44k
•
written 9.0 years ago by
D H
▴
30
You can read using read.gmt function from qusage
package.
or by GSA.read.gmt function from GSA
package.
you can try msigdbr package on https://cran.r-project.org/web/packages/msigdbr/vignettes/msigdbr-intro.html
it provides you with msigdb that compatable with fgsea and clusterProfiler. For example, I use it to do the fgea with human hallmark gene sets
library(msigdbr)
library(fgsea)
#Retrieve human H (hallmark gene sets)
msigdbr_df <- msigdbr(species = "human", category = "H")
head(msigdbr_df)
# A tibble: 6 x 15
gs_cat gs_subcat gs_name gene_symbol entrez_gene ensembl_gene human_gene_symb…
<chr> <chr> <chr> <chr> <int> <chr> <chr>
1 H "" HALLMA… ABCA1 19 ENSG0000016… ABCA1
2 H "" HALLMA… ABCB8 11194 ENSG0000019… ABCB8
3 H "" HALLMA… ACAA2 10449 ENSG0000016… ACAA2
4 H "" HALLMA… ACADL 33 ENSG0000011… ACADL
5 H "" HALLMA… ACADM 34 ENSG0000011… ACADM
6 H "" HALLMA… ACADS 35 ENSG0000012… ACADS
# fixing format to work with fgsea
pathwaysH = split(x = msigdbr_df$entrez_gene, f = msigdbr_df$gs_name)
# run fgsea enrichment
fgseaRes <- fgsea(pathways=pathwaysH, ranks, ..)
•
link
updated 5.0 years ago by
Ram
44k
•
written 9.0 years ago by
Zhilong Jia
★
2.2k
Login before adding your answer.
Traffic: 1618 users visited in the last hour
This post is related to R.
Thank you Zhilong!
Following the installation procedure (https://github.com/zhilongjia/cogena )
I tried to install devtools. However, I have Rstudio 2.15.2 and the devtools is not available.
Any recommendations?
you can install cogena via the following code:
Also, the package you used should be suitable for your research goal (I believe it's not only read a gmt file.), as Deepak listed two as well.
I tried the url but I get the following error:
By the way I use Mac, if that makes any difference.
Maybe
source("http://bioconductor.org/biocLite.R")