Skip to contents

This function calculates the ligand receptor interaction score using SingleCellSignalR. The output features are in the form of celltype a -> celltype b -- ligand 1 -> receptor 2 , which indicates the interaction between ligand 1 in celltype a and receptor 2 in celltype b.

It supports scRNA-seq.

Usage

run_CCI(data, type = "scrna", ncores = 1)

Arguments

data

A list object containing data matrix and celltype and sample vector.

type

input data type, either scrna, spatial_p, or spatial_t

ncores

number of cores

Value

a matrix of samples x features The features are in the form of ligand 1 receptor 2 celltype a, ligand 1 receptor 2 celltype b ... etc, with the numbers representing cell-cell interaction probability.

Examples


utils::data("example_scrnaseq" , package = "scFeatures")
data <- example_scrnaseq[1:1000, 1:100]
celltype <- data$celltype
sample <- data$sample
data <- as.matrix(data@assays$RNA@data)

alldata <- scFeatures:::formatData(data = data, celltype = celltype, sample = sample )
feature_CCI <- run_CCI(alldata, type = "scrna" ,  ncores = 1 )
#> Error in data(LRdb, package = "SingleCellSignalR"): could not find function "data"