Test the following hypotheses across gen_results enrichment results.
test_target_celltypes(
results = load_example_results(),
target_celltypes = get_target_celltypes(),
celltype_col = "cl_id",
tests = c("within_branches", "across_branches", "across_branches_per_celltype"),
method = c("glm", "anova"),
within_var = "hpo_id",
ancestor_var = "ancestor_name",
q_threshold = 0.05,
cores = 1
)
The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results
A named list of HPO branches and matched CL ids.
Name of the cell type column in the results
.
The types of tests to conduct.
"within_branches" Are on-target cell types enriched for significant results?
"across_branches" Are on-target cell types enriched for significant results across branches?
"across_branches_per_celltype" Are on-target cell types enriched for significant results across branches per cell type?
Methods to run stats with.
Within-subject variable.
The name of the results
column
containing the ancestor name.
The q value threshold to subset the results
by.
The number of cores to run in parallel (e.g. 8) int
.
res <- test_target_celltypes(tests="within_branches")
#> Adding level-2 ancestor to each HPO ID.
#> Adding ancestor metadata.
#> Ancestor metadata already present. Use force_new=TRUE to overwrite.
#> 2,201,892 associations remain after filtering.
#> Mapping cell types to cell ontology terms.
#> Adding stage information.
#> Translating ontology terms to ids.
#> Loading cached ontology: /github/home/.cache/R/KGExplorer/cl.rds
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> Running tests: within_branches