bootstrap_ligand_activity_analysis: Run ligand activity analysis with bootstrap

View source: R/application_prediction.R

bootstrap_ligand_activity_analysisR Documentation

Run ligand activity analysis with bootstrap

Description

bootstrap_ligand_activity_analysis Randomly sample a gene set from all expressed genes in the receiver cell type, then perform ligand activity analysis on this gene set. This 'null gene set' has equal length to the gene set of interest.

Usage

bootstrap_ligand_activity_analysis(expressed_genes_receiver, geneset_oi, background_expressed_genes, ligand_target_matrix, potential_ligands, n_iter = 10, n_cores = 1, parallel_func = "mclapply")

Arguments

expressed_genes_receiver

Genes expressed in the receiver cell type

geneset_oi

Character vector of the gene symbols of genes of which the expression is potentially affected by ligands from the interacting cell.

background_expressed_genes

Character vector of gene symbols of the background, non-affected, genes (can contain the symbols of the affected genes as well).

ligand_target_matrix

The NicheNet ligand-target matrix denoting regulatory potential scores between ligands and targets (ligands in columns).

potential_ligands

Character vector giving the gene symbols of the potentially active ligands you want to define ligand activities for.

n_iter

Number of iterations to perform (Default: 10)

n_cores

Number of cores to use for parallelization (Default: 1)

parallel_func

Parallelization function to use from "mclapply", "pbmclapply", or "parLapply" (Default: "mclapply")

Value

List of n_iter elements, each element containing the output of predict_ligand_activities for a random gene set

Examples

## Not run: 
permutations <- bootstrap_ligand_activity_analysis(expressed_genes_receiver, geneset_oi, background_expressed_genes,
                           ligand_target_matrix, potential_ligands, n_iter = 10, n_cores = 1, parallel_func = "mclapply")

## End(Not run)

saeyslab/nichenetr documentation built on April 27, 2024, 9:24 p.m.