working with .gmt files

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!

 


myposts

• 9.5k views

updated 2 hours ago by

▴

120

written 5.7 years ago by

▴

10

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 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, ..)

updated 20 months ago by

34k

written 5.7 years ago by

&starf;

1.9k


Login
before adding your answer.

Traffic: 2728 users visited in the last hour

Read more here: Source link