Skip to contents

Internal function that runs the CAMERA competitive gene-set test (camera) of an expression matrix against the cached CTD chemical gene sets. Unlike ORA/GSEA — which take a single (ranked) gene list — CAMERA tests, for each chemical, whether its target genes show a stronger differential signal than the rest of the transcriptome under a user-supplied design and contrast, while accounting for inter-gene correlation.

Usage

.run_camera(
  expr,
  design,
  contrast,
  id_type = NULL,
  pAdjustMethod = "BH",
  chemicals_meta,
  cache_dir,
  interaction_types = NULL,
  ...
)

Arguments

expr

Numeric expression matrix (genes x samples). rownames(expr) must be Entrez IDs or HGNC symbols matching the cached CTD gene sets.

design

Design matrix produced e.g. by model.matrix.

contrast

Either a column number or column name of design, or a numeric contrast vector.

id_type

Either "entrez", "symbol", or NULL for auto-detection from rownames(expr).

pAdjustMethod

Method passed to p.adjust to compute the padj column.

chemicals_meta

Data frame with columns ChemicalID and ChemicalName, used to annotate results.

cache_dir

Directory holding the cached CTD .rda files.

...

Forwarded to camera (e.g. inter.gene.cor, use.ranks, allow.neg.cor, trend.var).

Value

A data frame with columns ChemicalID, ChemicalName, NGenes, Direction, Correlation (if reported), pvalue, padj, sorted by padj ascending.