Skip to content

Commit

Permalink
getGenesets: update msigdb collections
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeistlinger committed Jan 9, 2021
1 parent 0e0286b commit b295985
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: EnrichmentBrowser
Version: 2.21.8
Version: 2.21.9
Date: 2020-08-10
Title: Seamless navigation through combined results of set-based and
network-based enrichment analysis
Expand Down
15 changes: 9 additions & 6 deletions R/getGenesets.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
###############################################################################
##############################################################################
#
# Author: ludwig geistlinger
# Date: 16 June 2010
Expand Down Expand Up @@ -68,7 +68,7 @@
#' MSigDB collection category: 'H' (hallmark),
#' 'C1' (genomic position), 'C2' (curated databases), 'C3' (binding site motifs),
#' 'C4' (computational cancer), 'C5' (Gene Ontology), 'C6' (oncogenic),
#' 'C7' (immunologic). See references.
#' 'C7' (immunologic), 'C8' (cell type). See references.
#' \item subcat: Character. MSigDB collection subcategory. Depends on the
#' chosen MSigDB collection category. For example, 'MIR' to obtain microRNA targets
#' from the 'C3' collection. See references.}
Expand Down Expand Up @@ -352,11 +352,15 @@ writeGMT <- function(gs, gmt.file)
# MSigDB
#
.getMSigDb <- function(org, gene.id.type, cache, return.type,
cat = c("H", paste0("C", 1:7)),
cat = c("H", paste0("C", 1:8)),
subcat = NA)
{
cat <- match.arg(cat)

isAvailable("msigdbr", type = "software")
supp.cats <- unique(msigdbr::msigdbr_collections()$gs_cat)
if(!(cat %in% supp.cats))
stop(gettextf("'cat' should be one of %s",
paste(dQuote(supp.cats), collapse = ", ")), domain = NA)

gs.tag <- "gs"
if(return.type == "GeneSetCollection") gs.tag <- paste0(gs.tag, "c")

Expand All @@ -372,7 +376,6 @@ writeGMT <- function(gs, gmt.file)
ind <- match(org, SPECIES[,"kegg"])
morg <- SPECIES[ind, "tax"]

isAvailable("msigdbr", type = "software")
if(!(morg %in% msigdbr::msigdbr_species()$species_name))
stop("Organism not supported")

Expand Down
6 changes: 3 additions & 3 deletions R/getMicrobeSets.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ names(MPA.TAX.LEVELS) <- TAX.LEVELS

# obtain study, experiment, and signature tables
einfo <- .getExpInfo()
sigs <- read.csv("https://bugsigdb.org/Special:Ask/-5B-5BCategory:Signatures-5D-5D/-3FOriginal-20page-20name%3DSignature-20page-20name/-3FRelated-20experiment%3DExperiment/-3FRelated-20study%3DStudy/-3FSource-20data%3DSource/-3FCurated-20date/-3FCurator/-3FRevision-20editor/-3FDescription/-3FAbundance-20in-20Group-201/-3FNCBI-20export%3DMetaPhlAn-20taxon-20names/-3FNCBI-20export-20ids%3DNCBI-20Taxonomy-20IDs/mainlabel%3D-2D/limit%3D5000/offset%3D0/format%3Dcsv/searchlabel%3DDownload-20all-20Signatures-20(CSV)/filename%3Dsignatures.csv")
sigs <- read.csv("https://tinyurl.com/yakgsowm")

# extract signatures
snames <- .makeSigNames(sigs, einfo)
Expand Down Expand Up @@ -178,7 +178,7 @@ names(MPA.TAX.LEVELS) <- TAX.LEVELS

.getExpInfo <- function()
{
exps <- read.csv("https://bugsigdb.org/w/index.php?title=Special:Ask&x=-5B-5BCategory%3AExperiments-5D-5D%2F-3FOriginal-20page-20name%3DExperiment-20page-20name%2F-3FRelated-20study%3DStudy%2F-3FLocation-20of-20subjects%2F-3FHost-20species%2F-3FBody-20site%2F-3FCondition%2F-3FGroup-200-20name%2F-3FGroup-201-20name%2F-3FGroup-201-20definition%2F-3FGroup-200-20sample-20size%2F-3FGroup-201-20sample-20size%2F-3FAntibiotics-20exclusion%2F-3FSequencing-20type%2F-3F16s-20variable-20region%2F-3FSequencing-20platform%2F-3FStatistical-20test%2F-3FSignificance-20threshold%2F-3FMHT-20correction%2F-3FLDA-20Score-20above%2F-3FMatched-20on%2F-3FConfounders-20controlled-20for%2F-3FPielou%2F-3FShannon%2F-3FChao1%2F-3FSimpson%2F-3FInverse-20Simpson%2F-3FRichness&mainlabel=-&limit=5000&order=asc&sort=Page%20sort%20number&offset=0&format=csv&searchlabel=Download%20all%20Experiments%20%28CSV%29&filename=experiments.csv")
exps <- read.csv("https://tinyurl.com/yb2fmpa3")

is.study <- grepl("^Study [0-9]+$", exps[["Study"]])
is.exp <- grepl("^Experiment [0-9]+$", exps[["Experiment.page.name"]])
Expand All @@ -201,7 +201,7 @@ names(MPA.TAX.LEVELS) <- TAX.LEVELS

.study2pmid <- function()
{
studs <- read.csv("https://bugsigdb.org/Special:Ask/-5B-5BCategory:Studies-5D-5D/-3FStudy-20design/-3FPMID/-3FDOI/-3FURL/-3FAuthors/-3FTitle/-3FJournal/-3FYear/-3FAbstract/mainlabel%3DStudy-20page-20name/limit%3D5000/order%3Dasc/sort%3DPage-20sort-20number/offset%3D0/format%3Dcsv/searchlabel%3DDownload-20all-20Studies-20(CSV)/filename%3Dstudies.csv")
studs <- read.csv("https://tinyurl.com/ycg8fs9x")

s2pmid <- studs[["PMID"]]
names(s2pmid) <- studs[["Study.page.name"]]
Expand Down
2 changes: 1 addition & 1 deletion man/getGenesets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b295985

Please sign in to comment.