From b295985a90eb964ba92066b43b4f7b60f99634f9 Mon Sep 17 00:00:00 2001 From: lgeistlinger Date: Fri, 8 Jan 2021 20:00:12 -0500 Subject: [PATCH] getGenesets: update msigdb collections --- DESCRIPTION | 2 +- R/getGenesets.R | 15 +++++++++------ R/getMicrobeSets.R | 6 +++--- man/getGenesets.Rd | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b5d1d27..b21de42 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 diff --git a/R/getGenesets.R b/R/getGenesets.R index 32e7dd2..308cdee 100755 --- a/R/getGenesets.R +++ b/R/getGenesets.R @@ -1,4 +1,4 @@ -############################################################################### +############################################################################## # # Author: ludwig geistlinger # Date: 16 June 2010 @@ -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.} @@ -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") @@ -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") diff --git a/R/getMicrobeSets.R b/R/getMicrobeSets.R index 693afcc..e9601bd 100644 --- a/R/getMicrobeSets.R +++ b/R/getMicrobeSets.R @@ -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) @@ -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"]]) @@ -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"]] diff --git a/man/getGenesets.Rd b/man/getGenesets.Rd index 483fe51..5bee7df 100644 --- a/man/getGenesets.Rd +++ b/man/getGenesets.Rd @@ -77,7 +77,7 @@ For \code{db = "msigdb":} \itemize{ \item cat: Character. 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.}