Annotate genes in results with data from a CellTypeDataset (CTD). The following columns will be added:

  • "specificity" Cell-type specificity score.

  • "specificity_quantiles" Cell-type specificity quantile.

  • "mean_exp" Mean expression per cell-type.

  • "mean_exp_quantiles" Mean expression quantile per cell-type.

add_ctd(
  results = load_example_results(),
  ctd = load_example_ctd(),
  annotLevel = length(ctd),
  keep_specificity_quantiles = NULL,
  keep_mean_exp_quantiles = NULL,
  rep_dt = NULL,
  all.x = FALSE,
  by = c("gene_symbol", "CellType"),
  verbose = TRUE
)

Arguments

results

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

ctd

Cell Type Data List generated using generate_celltype_data.

annotLevel

An integer indicating which level of sct_data to analyse (Default: 1).

keep_specificity_quantiles

Which cell type specificity quantiles to keep (max quantile is 40).

keep_mean_exp_quantiles

Which cell type mean expression quantiles to keep (max quantile is 40).

rep_dt

Report table.

all.x

logical; if TRUE, then extra rows will be added to the output, one for each row in x that has no matching row in y. These rows will have 'NA's in those columns that are usually filled with values from y. The default is FALSE, so that only rows with data from both x and y are included in the output.

by

A vector of shared column names in x and y to merge on. This defaults to the shared key columns between the two tables. If y has no key columns, this defaults to the key of x.

verbose

Print messages.

Examples

results <- load_example_results()
results2 <- add_ctd(results=results)
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2023-10-09
#> Annotating phenos with Disease
#> Reading cached RDS file: phenotype.hpoa
#> + Version: v2023-10-09