View source: R/geneset_shifts.R
geneset_shifts | R Documentation |
This funciton is used primarily to generate geneshift plots to compare the AppSAA model vs 5XFAD, but why not generalize ...
geneset_shifts(
x,
genesets,
gsea.method = NULL,
colors = NULL,
ymin = 0.005,
ymax = 0.025,
bw.bg = 0.7,
bw.gs = 0.9,
ribbon_wrap_n = 18,
legend.position = "none",
columns = c("genesets", "results"),
xlims = NULL,
facet_scales = "free",
trim = 0.02,
with_stats = c(pvalue = "pval", FDR = "padj.by.collection"),
...
)
x |
A single FacileTtestFseaAnalysisResult or a named list of them. |
genesets |
character vector of geneset names to extract from the GeneSetDb objects from each results. |
colors |
aaaaarrrghhhhhhhhh |
with_stats |
A named character vector that specifies the gsea statistics
to print in each of the results. The values correspond to the column names
from the result table of the individual GSEA result, and the |
... |
arbitrary number of named ffsea results |
stats |
the name of the gsea result to pull pvalues from |
We assume that the ffsea results each have a GeneSetDb that has genesets by the same name in them.
The row and column order are determined by the order in which ffsea results and genesets are provided in the respective variables.
This will eventually go into the FacileAnalysis package
# We'll setup two ffsea (GSEA) results and plot geneset effects from each
efds <- FacileData::exampleFacileDataSet()
gdb.h <- sparrow::getMSigGeneSetDb("H", "human", id.type = "entrez")
dge <- list(
crc = efds %>%
FacileData::filter_samples(indication == "CRC") %>%
FacileAnalysis::flm_def(
covariate = "sample_type", numer = "tumor", denom = "normal",
batch = "sex") %>%
FacileAnalysis::fdge(method = "voom"),
blca = efds %>%
FacileData::filter_samples(indication == "BLCA") %>%
FacileAnalysis::flm_def(
covariate = "sample_type", numer = "tumor", denom = "normal",
batch = "sex") %>%
FacileAnalysis::fdge(method = "voom"))
gsea <- lapply(dge, FacileAnalysis::ffsea, gdb.h, "fgsea")
gs.1 <- geneset_shifts(
gsea,
c("beta cells" = "HALLMARK_PANCREAS_BETA_CELLS",
"angiogenesis" = "HALLMARK_ANGIOGENESIS"),
gsea.method = "fgsea",
columns = "genesets",
with_stats = c("pvalue" = "pval", "FDR" = "padj", NES = "NES"))
gs.1$plot
gs.2 <- geneset_shifts(
gsea,
c("beta cells" = "HALLMARK_PANCREAS_BETA_CELLS",
"angiogenesis" = "HALLMARK_ANGIOGENESIS"),
gsea.method = "fgsea",
columns = "results",
with_stats = c("pvalue" = "pval", "FDR" = "padj", NES = "NES"))
gs.2$plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.