top_enriched_pathways: Find enriched pathways in marker genes of IDclust

View source: R/interpretation.R

top_enriched_pathwaysR Documentation

Find enriched pathways in marker genes of IDclust

Description

Find enriched pathways in marker genes of IDclust

Usage

top_enriched_pathways(
  IDC_DA,
  top = 1,
  qval.th = 0.1,
  gene_col = "gene",
  website = c("Enrichr", "FlyEnrichr", "WormEnrichr", "YeastEnrichr", "FishEnrichr")[1],
  databases = c("MSigDB_Hallmark_2020", "GO_Molecular_Function_2021",
    "MSigDB_Oncogenic_Signatures"),
  order_by_database = TRUE,
  max_genes_enriched = 1000
)

Arguments

IDC_DA

A data.frame of differential features at each clustering iteration produced by iterative_differential_clustering() ("IDC_DA.qs").

top

An integer specifying the number of top pathways to retrieve per cluster.

qval.th

A numeric specifying the adjusted p.value below which a pathway is considered as significantly enriched

gene_col

A character specifying the column in which to retrieve the gene / feature name.

website

site requested

databases

(Required). Character vector of databases to search. See https://maayanlab.cloud/Enrichr/ for available databases.

order_by_database

A logical. If TRUE, row will appear in the order of the databases vector, then within each database are sorted by adjusted pvalue.

max_genes_enriched

An integer specifying the maximum number of genes per cluster to enrich. If there are more than max_genes_enriched genes in the list, will keep only the top max_genes_enriched genes for enrichment.

Examples

if(requireNamespace("enrichR")){
#scRNA
data("IDC_DA_scRNA", package = "IDclust")
library(enrichR)
top_enriched_pathways(
    IDC_DA_scRNA,
    top = 1,
    gene_col = "gene",
    qval.th = 0.1)

#scEpigenomics
data("scExp", package = "IDclust")
data("IDC_DA_scEpigenomics", package = "IDclust")

# We must first add the gene information to the DA list: 
IDC_DA_scEpigenomics = add_gene_to_DA_list(
    scExp = scExp, 
    IDC_DA = IDC_DA_scEpigenomics,
    feature_ID_col = "ID", 
    gene_col = "Gene", 
    distanceToTSS = 1000,
    split = TRUE,
    split_char = ", "
)

top_enriched_pathways(
    IDC_DA_scEpigenomics,
    top = 1,
    gene_col = "Gene",
    qval.th = 0.1
)
}

vallotlab/IDclust documentation built on July 5, 2024, 3:26 p.m.