add_ctd: Add CellTypeDataset

View source: R/add_ctd.R

add_ctdR Documentation

Add CellTypeDataset

Description

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.

Usage

add_ctd(
  results = load_example_results(),
  ctd = load_example_ctd(),
  annotLevel = length(ctd),
  keep_specificity_quantiles = NULL,
  keep_mean_exp_quantiles = NULL,
  keep_celltypes = NULL,
  rep_dt = NULL,
  all.x = FALSE,
  allow.cartesian = TRUE,
  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

CellTypeDataset 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).

keep_celltypes

A character vector of cell types to keep.

rep_dt

Report table.

all.x

logical; if TRUE, rows from x which have no matching row in y are included. These rows will have 'NA's in the 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.

allow.cartesian

See allow.cartesian in [.data.table.

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()[seq(100),]
results2 <- add_ctd(results=results)

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