Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension for gs descriptions #23

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update
Scrape gene set descriptions from gsea-msigdb.org collections webpage and store that in desc
ozturan authored Dec 8, 2022
commit 1839091735241f9440cde47579954ada8561520f
11 changes: 11 additions & 0 deletions data-raw/msigdbr-prepare.R
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ library(stringr)
library(glue)
library(xml2)
library(usethis)
library(rvest)
options(pillar.print_max = 100)

# Import MSigDB gene sets -----
@@ -86,6 +87,15 @@ msigdbr_genesets <- mdb_tbl %>%

if (nrow(msigdbr_genesets) != sum(msigdb_category_genesets$n_genesets)) stop()

# Scrape gene set descriptions from gsea-msigdb.org collections webpage
html <- read_html("http://www.gsea-msigdb.org/gsea/msigdb/collections.jsp")
desc <- html %>%
html_elements("th") %>% html_text2() %>%
str_extract(., ".*(?=\\n)") %>% as.tibble() %>%
filter(!row_number() %in% c(12, 15, 22, 32)) %>% ungroup() %>%
slice(-1) %>%
rbind(value="H: hallmark gene sets")

# Extract gene set members -----

# Create a table for genes in a tidy/long format (one gene per row)
@@ -244,6 +254,7 @@ format(object.size(msigdbr_genes), units = "Mb")
use_data(
msigdbr_genesets,
msigdbr_geneset_genes,
desc,
msigdbr_genes,
internal = TRUE,
overwrite = TRUE,