convert_cluster_to_settings: Convert cluster assignment to settings format suitable for...

View source: R/application_prediction.R

convert_cluster_to_settingsR Documentation

Convert cluster assignment to settings format suitable for target gene prediction.

Description

convert_cluster_to_settings Convert cluster assignment to settings format suitable for target gene prediction.

Usage

convert_cluster_to_settings(i, cluster_vector, setting_name, setting_from, background = NULL)

Arguments

i

The cluster number of the cluster of interest to which genes should belong

cluster_vector

Named vector containing the cluster number to which every gene belongs

setting_name

Base name of the setting

setting_from

Active ligands for the specific setting

background

NULL or a character vector of genes belonging to the background. When NULL: the background will be formed by genes belonging to other clusters that the cluster of interest. Default NULL. If not NULL and genes present in the cluster of interest are in this vector of background gene names, these genes will be removed from the background.

Value

A list with following elements: $name (indicating the cluster id), $from, $response. $response is a gene-named logical vector indicating whether the gene is part of the respective cluster.

Examples

## Not run: 
genes_clusters = c("TGFB1" = 1,"TGFB2" = 1,"TGFB3" = 2)
cluster_settings = lapply(seq(length(unique(genes_clusters))), convert_cluster_to_settings, cluster_vector = genes_clusters, setting_name = "example", setting_from = "BMP2")

## End(Not run)


saeyslab/nichenetr documentation built on March 26, 2024, 9:22 a.m.