### Install org.Hs.eg.db Package Source: https://github.com/igordot/msigdbr/blob/main/revdep/failures.md This snippet shows the installation process for the 'org.Hs.eg.db' R package, which is a dependency for 'pathfindR'. The output indicates that the installation is attempted for both 'Devel' and 'CRAN' versions, suggesting a check across different package repositories or development stages. ```text installing the source package ‘org.Hs.eg.db’ ``` -------------------------------- ### Install msigdbr R Package Source: https://context7.com/igordot/msigdbr/llms.txt This snippet shows how to install the msigdbr package from CRAN using the install.packages() function in R. ```r install.packages("msigdbr") ``` -------------------------------- ### msigdbr() Function Usage Source: https://github.com/igordot/msigdbr/blob/main/pkgdown/index.md Demonstrates how to use the msigdbr() function to retrieve gene sets. Includes examples for default usage, specifying species, and specifying a collection. ```APIDOC ## msigdbr() Function Usage ### Description This section details the usage of the `msigdbr()` function from the `msigdbr` R package to access Molecular Signatures Database (MSigDB) gene sets. ### Method Function Call ### Endpoint N/A (R function) ### Parameters #### Query Parameters - **species** (string) - Optional - The species for which to retrieve gene sets (e.g., "human", "mouse"). Defaults to "human". - **collection** (string) - Optional - The MSigDB collection to retrieve (e.g., "H" for Hallmark gene sets, "C2" for curated gene sets). Defaults to all collections. ### Request Example ```R # Load the library library(msigdbr) # Get all human gene sets genesets_human <- msigdbr() # Get mouse gene sets genesets_mouse <- msigdbr(species = "mouse") # Get Hallmark gene sets for mouse genesets_hallmark_mouse <- msigdbr(species = "mouse", collection = "H") ``` ### Response #### Success Response (200) - **genesets** (data.frame) - A data frame containing gene sets and their member genes. Columns typically include gene_set_name, gene_symbol, entrez_gene_id, gs_id, gs_cat, gs_subcat, gs_pmid, gs_description, gs_url, human_entrez_gene_id, human_gene_symbol. #### Response Example ```R # Example output structure (truncated) # gene_set_name gene_symbol entrez_gene_id gs_id gs_cat gs_subcat ... # 1 HALLMARK_APICAL_BASAL_MEMBRANE_PLASMA_MEMBRANE ABCC13 10053 GO0005886 GO Biological Process GO:0005886 ... # 2 HALLMARK_APICAL_BASAL_MEMBRANE_PLASMA_MEMBRANE ABCC1 10053 GO0005886 GO Biological Process GO:0005886 ... # ... (many more rows) ``` ``` -------------------------------- ### Compile CAESAR.Suite R Package Source: https://github.com/igordot/msigdbr/blob/main/revdep/failures.md This snippet shows the compilation process for the CAESAR.Suite R package using clang++. It includes C++ compilation steps for RcppExports.cpp, gene_embed.cpp, and imfactor.cpp, followed by dynamic library linking. The output indicates compilation errors related to linker issues and missing libraries, resulting in a failed installation. ```bash * installing *source* package ‘CAESAR.Suite’ ... ** this is package ‘CAESAR.Suite’ version ‘0.3.0’ ** package ‘CAESAR.Suite’ successfully unpacked and MD5 sums checked ** using staged installation ** libs using C++ compiler: ‘Apple clang version 17.0.0 (clang-1700.6.4.2)’ using SDK: ‘MacOSX26.2.sdk’ clang++ -arch x86_64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/include" -DNDEBUG -I'/Users/id460/repos/msigdbr/revdep/library.noindex/CAESAR.Suite/Rcpp/include' -I'/Users/id460/repos/msigdbr/revdep/library.noindex/CAESAR.Suite/RcppArmadillo/include' -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o clang++ -arch x86_64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/include" -DNDEBUG -I'/Users/id460/repos/msigdbr/revdep/library.noindex/CAESAR.Suite/Rcpp/include' -I'/Users/id460/repos/msigdbr/revdep/library.noindex/CAESAR.Suite/RcppArmadillo/include' -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c gene_embed.cpp -o gene_embed.o clang++ -arch x86_64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/include" -DNDEBUG -I'/Users/id460/repos/msigdbr/revdep/library.noindex/CAESAR.Suite/Rcpp/include' -I'/Users/id460/repos/msigdbr/revdep/library.noindex/CAESAR.Suite/RcppArmadillo/include' -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c imfactor.cpp -o imfactor.o clang++ -arch x86_64 -std=gnu++17 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib -L/opt/R/x86_64/lib -o CAESAR.Suite.so RcppExports.o gene_embed.o imfactor.o -L/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib -lRblas -L/opt/gfortran/lib/gcc/x86_64-apple-darwin20.0/14.2.0 -L/opt/gfortran/lib -lemutls_w -lheapt_w -lgfortran -lquadmath -F/Library/Frameworks/R.framework/Versions/4.5-x86_64 -framework R ld: warning: search path '/opt/gfortran/lib/gcc/x86_64-apple-darwin20.0/14.2.0' not found ld: library 'emutls_w' not found clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [CAESAR.Suite.so] Error 1 ERROR: compilation failed for package ‘CAESAR.Suite’ * removing ‘/Users/id460/repos/msigdbr/revdep/checks.noindex/CAESAR.Suite/old/CAESAR.Suite.Rcheck/CAESAR.Suite’ ``` -------------------------------- ### Filter and Manipulate Gene Sets with Tidyverse Source: https://context7.com/igordot/msigdbr/llms.txt Provides examples of advanced data manipulation, including filtering by name patterns, counting genes per set, and subsetting by size. ```r library(msigdbr) library(dplyr) all_sets <- msigdbr(species = "Homo sapiens") # Filter to specific gene sets by name pattern hypoxia_sets <- all_sets %>% filter(grepl("HYPOXIA", gs_name)) # Count genes per gene set genes_per_set <- all_sets %>% group_by(gs_name) %>% summarise(n_genes = n_distinct(gene_symbol)) %>% arrange(desc(n_genes)) # Filter gene sets by size filtered_sets <- all_sets %>% group_by(gs_name) %>% filter(n_distinct(gene_symbol) >= 15 & n_distinct(gene_symbol) <= 500) %>% ungroup() ``` -------------------------------- ### Retrieve and Filter MSigDB Gene Sets Source: https://context7.com/igordot/msigdbr/llms.txt Demonstrates how to list available collections for a species and retrieve specific gene sets using collection and subcollection parameters. ```r library(msigdbr) # Get available collections for mouse database mouse_collections <- msigdbr_collections(db_species = "MM") print(mouse_collections) # Get specific pathway gene sets kegg_sets <- msigdbr(collection = "C2", subcollection = "CP:KEGG_LEGACY") go_bp_sets <- msigdbr(collection = "C5", subcollection = "GO:BP") reactome_sets <- msigdbr(collection = "C2", subcollection = "CP:REACTOME") ``` -------------------------------- ### List Available Collections with msigdbr_collections() Source: https://context7.com/igordot/msigdbr/llms.txt This snippet demonstrates how to use the msigdbr_collections() function to list all available gene set collections and subcollections within MSigDB. This information is useful for specifying the 'collection' and 'subcollection' parameters in the msigdbr() function. ```r library(msigdbr) # Get available collections for human database (default) human_collections <- msigdbr_collections() print(human_collections) ``` -------------------------------- ### Retrieve MSigDB Gene Sets with msigdbr() Source: https://context7.com/igordot/msigdbr/llms.txt Demonstrates the usage of the main msigdbr() function to retrieve gene sets. It covers fetching all human gene sets, gene sets with mouse orthologs, mouse-native gene sets, specific collections/subcollections, and gene sets for other species like zebrafish. The output is a tibble containing gene and gene set information, including database version and available columns. ```r library(msigdbr) # Get all human gene sets (default) all_human_sets <- msigdbr() head(all_human_sets) # Get all gene sets with mouse orthologs (human database with ortholog mapping) mouse_orthologs <- msigdbr(species = "Mus musculus") head(mouse_orthologs) # Get mouse-native gene sets from mouse MSigDB database mouse_native_sets <- msigdbr(db_species = "MM", species = "Mus musculus") head(mouse_native_sets) # Get Hallmark collection gene sets hallmark_sets <- msigdbr(species = "human", collection = "H") head(hallmark_sets) # Get CGP (chemical and genetic perturbations) subcollection for rat rat_cgp_sets <- msigdbr( species = "Rattus norvegicus", collection = "C2", subcollection = "CGP" ) head(rat_cgp_sets) # Get gene sets with zebrafish orthologs zebrafish_sets <- msigdbr(species = "Danio rerio") head(zebrafish_sets) # Check the MSigDB version included in the data unique(all_human_sets$db_version) # View available columns in the output colnames(all_human_sets) ``` -------------------------------- ### Retrieve Orthologous Gene Sets in R Source: https://github.com/igordot/msigdbr/blob/main/pkgdown/index.md Shows how to fetch gene sets for a different species, such as mouse, by specifying the 'species' argument in the `msigdbr()` function. This is useful for cross-species comparative analyses. ```r genesets <- msigdbr(species = "mouse") ``` -------------------------------- ### List Available Species with msigdbr_species() Source: https://context7.com/igordot/msigdbr/llms.txt This snippet shows how to use the msigdbr_species() function to retrieve a list of all supported species for ortholog mapping. The output is a tibble containing species scientific and common names, which can be used with the 'species' parameter in msigdbr(). ```r library(msigdbr) # Get all available species available_species <- msigdbr_species() print(available_species) # Use either scientific or common name mouse_sets <- msigdbr(species = "Mus musculus") # Scientific name mouse_sets <- msigdbr(species = "mouse") # Common name ``` -------------------------------- ### Integrate msigdbr with clusterProfiler Source: https://context7.com/igordot/msigdbr/llms.txt Shows how to prepare MSigDB data for over-representation analysis (ORA) using Entrez IDs or gene symbols with the clusterProfiler package. ```r library(msigdbr) library(dplyr) library(clusterProfiler) # Prepare gene sets for clusterProfiler using NCBI/Entrez IDs msigdbr_df <- msigdbr(species = "Homo sapiens", collection = "H") msigdbr_t2g <- msigdbr_df %>% dplyr::distinct(gs_name, ncbi_gene) # Perform enrichment analysis gene_ids <- c("7157", "675", "472", "207", "1956") result <- enricher(gene = gene_ids, TERM2GENE = msigdbr_t2g, pvalueCutoff = 0.05, qvalueCutoff = 0.2) head(result) ``` -------------------------------- ### OlinkAnalyze R Package Check Timeout Source: https://github.com/igordot/msigdbr/blob/main/revdep/failures.md This entry describes a common issue encountered during the analysis of the OlinkAnalyze R package, where the R CMD check process times out. This indicates potential performance problems or excessive resource usage during the package's integrity checks. ```text Run `revdepcheck::revdep_details(, "OlinkAnalyze")` for more info ## In both * R CMD check timed out ``` -------------------------------- ### Integrate msigdbr with GSVA Source: https://context7.com/igordot/msigdbr/llms.txt Demonstrates how to perform Gene Set Variation Analysis (GSVA) by converting msigdbr data into a list format compatible with expression matrices. ```r library(msigdbr) library(GSVA) # Get gene sets as a named list msigdbr_df <- msigdbr(species = "Homo sapiens", collection = "H") msigdbr_list <- split(x = msigdbr_df$gene_symbol, f = msigdbr_df$gs_name) # Create example expression matrix expr_matrix <- matrix(rnorm(5000 * 10), nrow = 5000, ncol = 10) # Run GSVA gsva_param <- gsvaParam(exprData = expr_matrix, geneSets = msigdbr_list, minSize = 10, maxSize = 500) gsva_results <- gsva(gsva_param) ``` -------------------------------- ### Filter Gene Sets by Collection in R Source: https://github.com/igordot/msigdbr/blob/main/pkgdown/index.md Illustrates how to retrieve gene sets from a specific MSigDB collection, like the Hallmark gene sets ('H'), by using both 'species' and 'collection' arguments in the `msigdbr()` function. This allows for targeted analysis of specific gene set categories. ```r genesets <- msigdbr(species = "mouse", collection = "H") ``` -------------------------------- ### Access MSigDB Gene Sets in R Source: https://github.com/igordot/msigdbr/blob/main/pkgdown/index.md Demonstrates how to load the msigdbr package and access all available gene sets. The `msigdbr()` function by default retrieves human gene sets. The output is a data frame containing gene set information and their member genes. ```r library(msigdbr) genesets <- msigdbr() ``` -------------------------------- ### Integrate msigdbr with fgsea Source: https://context7.com/igordot/msigdbr/llms.txt Converts msigdbr data frames into named lists suitable for Gene Set Enrichment Analysis (GSEA) using the fgsea package. ```r library(msigdbr) library(fgsea) # Get Hallmark gene sets as a named list msigdbr_df <- msigdbr(species = "Homo sapiens", collection = "H") msigdbr_list <- split(x = msigdbr_df$gene_symbol, f = msigdbr_df$gs_name) # Run fgsea with gene-level statistics set.seed(42) gene_stats <- setNames(rnorm(1000), sample(unique(msigdbr_df$gene_symbol), 1000)) fgsea_results <- fgsea(pathways = msigdbr_list, stats = gene_stats, minSize = 15, maxSize = 500) head(fgsea_results[order(pval), ]) ``` -------------------------------- ### Export Gene Sets to GMT Format in R Source: https://context7.com/igordot/msigdbr/llms.txt This R function exports a data frame of gene sets into the GMT file format, where each line represents a single gene set. It takes a data frame with 'gene_symbol' and 'gs_name' columns and a file path as input. The output is a tab-delimited file suitable for various enrichment analysis tools. ```r export_gmt <- function(df, file) { gene_sets <- split(df$gene_symbol, df$gs_name) lines <- sapply(names(gene_sets), function(name) { genes <- unique(gene_sets[[name]]) paste(c(name, "na", genes), collapse = "\t") }) writeLines(lines, file) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.