This subsets the Rare disease EWCE results by cell type, q threshold and fold change.

subset_phenos(
  cell_type,
  ancestor = NULL,
  results = load_example_results(),
  hpo = HPOExplorer::get_hpo(),
  phenotype_to_genes = HPOExplorer::load_phenotype_to_genes(),
  q_threshold = 5e-04,
  fold_threshold = 1,
  verbose = TRUE
)

Arguments

cell_type

The cell type of interest to be plotted. Can be a single string (e.g. "Astrocytes") or a character vector of multiple cell types (e..g. c("Astrocytes","Microglia")). Set to NULL if you wish to include all cell-types that are available (after q_threshold and fold_threshold filtering). If >1 cell-type remains, results will be aggregated automatically such that there is only 1 node per phenotype.

ancestor

The ancestor to get all descendants of. If NULL, returns the entirely ontology.

results

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

hpo

Human Phenotype Ontology object, loaded from ontologyIndex.

phenotype_to_genes

Output of load_phenotype_to_genes mapping phenotypes to gene annotations.

q_threshold

The q value threshold to subset the results by.

fold_threshold

The minimum fold change in specific expression to subset the results by.

verbose

Print messages.

Value

A data frame of results taken from the main data frame of results.

Examples

phenos <- subset_phenos(cell_type = "Amacrine cells",
                        ancestor = "Neurodevelopmental delay")
#> Subsetting results by q_threshold and fold_change.
#> WARNING!: CellType 'Amacrine cells' ... not found in results.
#>   Defaulting to first CellType available: 'ENS_glia'
#> 22,444 associations remain after filtering.
#> Subsetting phenotypes to only ancestors of: Neurodevelopmental delay
#> Translating all phenotypes to HPO IDs.
#>  All local files already up-to-date!
#> + Returning a vector of phenotypes (same order as input).
#> 453 associations remain after filtering.