View source: R/gene_set_enrichment.R
gene_set_enrichment | R Documentation |
Using the layer-level (group-level) data, this function evaluates whether
list of gene sets (Ensembl gene IDs) are enriched among the significant
genes (FDR < 0.1 by default) genes for a given model type result. Test the
alternative hypothesis that OR > 1, i.e. that gene set is over-represented in the
set of enriched genes. If you want to check depleted genes, change reverse
to TRUE
.
gene_set_enrichment(
gene_list,
fdr_cut = 0.1,
modeling_results = fetch_data(type = "modeling_results"),
model_type = names(modeling_results)[1],
reverse = FALSE
)
gene_list |
A named |
fdr_cut |
A |
modeling_results |
Defaults to the output of
|
model_type |
A named element of the |
reverse |
A |
Check https://github.com/LieberInstitute/HumanPilot/blob/master/Analysis/Layer_Guesses/check_clinical_gene_sets.R to see a full script from where this family of functions is derived from.
A table in long format with the enrichment results using
stats::fisher.test()
.
OR
odds ratio.
Pval
p-value for fisher.test()
.
test
group or layer in the modeling_results
.
NumSig
Number of genes from the gene set present in modeling_results
&
with fdr < fdr_cut
and t_stat > 0
(unless reverse = TRUE) for test
in
modeling results.
SetSize
Number of genes from modeling_results
present in gene_set
.
ID
name of gene set.
model_type
record of input model type from modeling results
.
fdr_cut
record of input frd_cut
.
Andrew E Jaffe, Leonardo Collado-Torres
Other Gene set enrichment functions:
gene_set_enrichment_plot()
## Read in the SFARI gene sets included in the package
asd_sfari <- utils::read.csv(
system.file(
"extdata",
"SFARI-Gene_genes_01-03-2020release_02-04-2020export.csv",
package = "spatialLIBD"
),
as.is = TRUE
)
## Format them appropriately
asd_sfari_geneList <- list(
Gene_SFARI_all = asd_sfari$ensembl.id,
Gene_SFARI_high = asd_sfari$ensembl.id[asd_sfari$gene.score < 3],
Gene_SFARI_syndromic = asd_sfari$ensembl.id[asd_sfari$syndromic == 1]
)
## Obtain the necessary data
if (!exists("modeling_results")) {
modeling_results <- fetch_data(type = "modeling_results")
}
## Compute the gene set enrichment results
asd_sfari_enrichment <- gene_set_enrichment(
gene_list = asd_sfari_geneList,
modeling_results = modeling_results,
model_type = "enrichment"
)
## Explore the results
asd_sfari_enrichment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.