run_congenital_enrichment: Run congenital enrichment analyses

View source: R/run_congenital_enrichment.R

run_congenital_enrichmentR Documentation

Run congenital enrichment analyses

Description

First, this function computes the mean difference in association p-values between a given phenotype and the congenital and non-congenital versions of a cell type (the fetal_nonfetal_pdiff column). It then sorts the results from the largest to the smallest difference. Here, a positive difference indicates that the phenotype is more associated with the fetal/embryonic version of the cell type, while a negative difference indicates that the phenotype is more associated with the adult version. Next, it runs enrichment analyses for the top and bottom N phenotypes using the dag_enrich_on_offsprings function. Finally, it run enrichment analyses for the top and bottom N cell types.

Usage

run_congenital_enrichment(
  results,
  hpo = HPOExplorer::get_hpo(),
  cl = KGExplorer::filter_ontology(KGExplorer::get_ontology("cl"), keep_descendants =
    "cell"),
  gpt_annot = HPOExplorer::gpt_annot_codify(),
  fetal_keywords = c("fetal", "fetus", "primordial", "hESC", "embryonic"),
  celltype_col = "author_celltype",
  top_n_phenotypes = 10,
  top_n_hpo = 50,
  top_n_cl = top_n_hpo,
  q_threshold = 0.05,
  prune = TRUE,
  ...
)

Arguments

results

The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results

hpo

Human Phenotype Ontology object, loaded from get_ontology.

cl

Cell Ontology (CL) object from KGExplorer::get_ontology("cl").

gpt_annot

A data.table of GPT annotations.

fetal_keywords

A character vector of keywords to identify fetal cell types.

celltype_col

The column name of the cell type.

top_n_phenotypes

Number of top and bottom phenotypes to return.

top_n_hpo

Number of top and bottom phenotypes to run enrichment analyses on.

top_n_cl

Number of top and bottom cell types to run enrichment analyses on.

q_threshold

The q value threshold to subset the results by.

prune

Prune redundant ancestral terms from the enrichment results using prune_ancestors.

...

Arguments passed on to simona::dag_enrich_on_offsprings

dag

An ontology_DAG object.

terms

A vector of term names.

min_hits

Minimal number of terms in an offspring set.

min_offspring

Minimal size of the offspring set.

Value

Named list of enrichment results.

Examples

results <- load_example_results()[ctd=="HumanCellLandscape"]
out <- run_congenital_enrichment(results=results)

neurogenomics/MultiEWCE documentation built on Sept. 28, 2024, 2:27 a.m.