### Install sparrow R Package using BiocManager Source: https://github.com/lianos/sparrow/blob/devel/README.md This R code snippet demonstrates how to install the development version of the `sparrow` R package using the `BiocManager` package. It specifies the package name 'sparrow' and requests the 'devel' version, which is suitable for accessing the latest features and updates. This is the recommended method for installing the development branch. ```R BiocManager::install("sparrow", version = "devel") ``` -------------------------------- ### Install sparrow R Package from GitHub using remotes Source: https://github.com/lianos/sparrow/blob/devel/README.md This R code snippet provides an alternative method to install the `sparrow` R package directly from its GitHub repository. It uses the `install_github` function from the `remotes` package, specifying the repository 'lianos/sparrow'. This method is useful for installing specific branches or versions not yet available through BiocManager. ```R remotes::install_github("lianos/sparrow") ``` -------------------------------- ### Perform Gene Set Enrichment Analysis (GSEA) with sparrow::seas Source: https://github.com/lianos/sparrow/blob/devel/README.md This R code snippet demonstrates how to perform a gene set enrichment analysis using the `sparrow` package. It loads necessary libraries, retrieves a human MSigDB hallmark gene set collection, prepares an example RNA-seq expression set, and then runs 'cameraPR' and 'fry' GSEA methods on tumor vs. normal samples using the `seas` function. The result is stored in an `mg` object, a `SparrowResult`. ```R library(sparrow) library(dplyr) bsc <- getMSigCollection('H', species = 'human', id.type = "entrez") vm <- exampleExpressionSet(dataset = 'tumor-vs-normal', do.voom = TRUE) mg <- seas(vm, bsc, c("cameraPR", "fry"), design = vm$design, contrast = "tumor") ``` -------------------------------- ### View Top 'cameraPR' GSEA Results from Sparrow Source: https://github.com/lianos/sparrow/blob/devel/README.md This R code snippet shows how to access and display the top results from a specific GSEA method ('cameraPR') stored within a `SparrowResult` object (`mg`). It pipes the results through `dplyr` functions to arrange them by p-value, select relevant columns (name, padj), and display the first few entries, demonstrating how to query and inspect GSEA outcomes. ```R results(mg, "cameraPR") %>% arrange(pval) %>% select(name, padj) %>% head ``` -------------------------------- ### Visualize Gene Set Expression Density with sparrow::iplot Source: https://github.com/lianos/sparrow/blob/devel/README.md This R code snippet uses the `iplot` function from the `sparrow` package to visualize the shift in expression of genes within a specific gene set ('HALLMARK_MYC_TARGETS_V1'). The `type = "density"` argument generates an interactive density plot, illustrating the distribution of gene expression changes for the selected gene set. This helps in understanding the overall expression pattern of the gene set. ```R iplot(mg, 'HALLMARK_MYC_TARGETS_V1', type = "density") ``` -------------------------------- ### Visualize Gene Set Enrichment (GSEA Plot) with sparrow::iplot Source: https://github.com/lianos/sparrow/blob/devel/README.md This R code snippet utilizes the `iplot` function from the `sparrow` package to create an interactive GSEA plot for a specified gene set ('HALLMARK_MYC_TARGETS_V1'). The `type = "gsea"` argument generates a traditional GSEA enrichment plot, showing the distribution of gene ranks and the enrichment score profile. This visualization helps in assessing the enrichment of the gene set within the ranked gene list. ```R iplot(mg, 'HALLMARK_MYC_TARGETS_V1', type = "gsea") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.