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

MSigDB C7 retrieval fails #45

Open
hypercompetent opened this issue Jun 8, 2022 · 0 comments
Open

MSigDB C7 retrieval fails #45

hypercompetent opened this issue Jun 8, 2022 · 0 comments

Comments

@hypercompetent
Copy link

Hi Monti Lab team,

Thanks for assembling this great toolkit! It's really streamlining my DEG pathway analysis.

I've run into a bug around retrieving the MSigDB C7 (Immunologic Signatures) gene sets, which I think is due to handling of categories without a subcategory.

Using "" as the subcategory for C7 doesn't work:

msigdb_imm <- msigdb_gsets("Homo sapiens", "C7", "")

Error in msigdbr(species, category, subcategory): unknown subcategory
Traceback:

1. msigdb_gsets("Homo sapiens", "C7", "")
2. msigdb_download(species, category, subcategory)
3. msigdbr(species, category, subcategory)
4. stop("unknown subcategory")

It looks like msigdbr may be expecting NA for this case where there's no subcategory. However, this leads to a new error:

msigdb_imm <- msigdb_gsets("Homo sapiens", "C7", NA)

Error in if (name == "Custom" & !quiet) warning("Describing genesets with a name will aid reproducibility"): missing value where TRUE/FALSE needed
Traceback:

1. msigdb_gsets("Homo sapiens", "C7", NA)
2. gsets$new(genesets, name = name, version = version, clean = clean)
3. initialize(...)

This can be fixed by adding is.na(subcategory) to the ifelse switch in the msigdb_gsets function. This version works:

msigdb_gsets2 <- function(species, category, subcategory = "", clean = FALSE) 
{
    genesets <- msigdb_download(species, category, subcategory)
    name <- ifelse(subcategory == "" | is.na(subcategory), category, paste(category, subcategory, sep = "."))
    version <- msigdb_version()
    gsets$new(genesets, name = name, version = version, clean = clean)
}

msigdb_imm <- msigdb_gsets2("Homo sapiens", "C7", NA)

In case it helps, I'm running hyperR v1.8.0, with msigdbr v7.5.1 .

Cheers,
-Lucas Graybuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant