run_phenomix: Run phenomix

View source: R/run_phenomix.R

run_phenomixR Documentation

Run phenomix

Description

Run many phenotype-cell type association tests in parallel using iterate_lm.

Usage

run_phenomix(
  ctd_name,
  annotLevel,
  ymat,
  test_method = "glm",
  metric = "specificity",
  ctd = load_example_ctd(file = paste0("ctd_", ctd_name, ".rds")),
  xmat = ctd[[annotLevel]][[metric]],
  save_path = file.path(tempfile(), "results", paste0("phenomix_", test_method, "_",
    metric), paste0("phenomix_", ctd_name, "_results.tsv.gz")),
  multivariate = FALSE,
  workers = NULL,
  force_new = FALSE,
  ...
)

Arguments

ctd_name

Name of the CTD to load.

annotLevel

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

ymat

gene x celltype matrix.

test_method

Association testing method to use.

metric

Which matrix within the CTD to use (e.g. "mean_exp","specificity","specificity_quantiles").

ctd

CellTypeDataset generated using generate_celltype_data.

xmat

gene x trait matrix.

save_path

Path to save the table of aggregated results to.

multivariate

If TRUE, runs tests with each column in xmat as a multivariate predictor in a single model (one model per column in yvar). IfFALSE, runs tests with each column in xmat as a univariate predictor in separate models (one model per column in yvar).

workers

Number (>1) or proportion (<1) of worker cores to use.

force_new

Overwrite previous results in the save_dir_tmp.

...

Additional parameters passed to the statistical test function.

Examples

## Not run: 
  ymat <- HPOExplorer::hpo_to_matrix()
  ymat <- ymat[,1:10]
  lm_res <- run_phenomix(ctd_name = "HumanCellLandscape",
                         annotLevel = 3,
                         ymat = ymat,
                         save_path=tempfile())

## End(Not run)

neurogenomics/MultiEWCE documentation built on April 22, 2024, 6:22 a.m.