1 Introduction

This guide provides an overview of the CCPlotR package, a small R package for visualising results from tools that predict cell-cell interactions from scRNA-seq data.

1.1 Motivation

Predicting cell-cell interactions from scRNA-seq data is now a common component of a single-cell analysis workflow (Armingol et al. (2021), Almet et al. (2021)). There have been many tools published in recent years specifically for this purpose (Dimitrov et al. (2022), Efremova et al. (2020), Hou et al. (2020), Jin et al. (2021)). These tools typically return a table of predicted interactions that depicts the sending and receiving cell type, the ligand and receptor genes and some sort of score for ranking the interactions. These tables can be quite large and depending on the amount of cell types included in the analysis, this data can get pretty complex and challenging to visualise. Many tools for predicting cell-cell interactions have built-in visualisation methods but some don’t and it can be time consuming and impractical to install some of these methods just for the purpose of visualising the results if you’re using a different tool to predict the interactions. For these reasons, we have developed a lightweight R package that allows the user to easily generate visualisations of cell-cell interactions with minimal code, regardless of which tool was used for predicting the interactions.

1.2 Installation


if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("CCPlotR")

## or for development version:

devtools::install_github("Sarah145/CCPlotR")

2 Input

CCPlotR makes generic plots that can be used to visualise results from multiple tools such as Liana, CellPhoneDB, NATMI etc. All it requires as input is a dataframe with columns source, target, ligand, receptor and score. It should look something like this:

source target ligand receptor score
B CD8 T HLA-DQA1 LAG3 7.22
B CD8 T HLA-DRA LAG3 5.59
CD8 T NK B2M KIR2DL3 5.52
B CD8 T HLA-DQA2 LAG3 5.41
NK B LGALS1 CD69 4.15
B CD8 T ICAM3 ITGAL 2.34

For some of the plots, there is an option to also show the expression of the ligands and receptors in each cell type. For those plots, a second dataframe is required, which holds the mean expression values for each gene in each cell type and should look something like this:

cell_type gene mean_exp
B ACTR2 0.363
B ADA 0.0170
B ADAM10 0.0833
B ADAM28 0.487
B ADCY7 0.0336
B ADRB2 0.0178

The package comes with toy datasets (toy_data, toy_exp) which you can see for examples of input data.

library(CCPlotR)
data(toy_data, toy_exp, package = 'CCPlotR')
head(toy_data)
#> # A tibble: 6 × 5
#>   source target ligand   receptor score
#>   <chr>  <chr>  <chr>    <chr>    <dbl>
#> 1 B      CD8 T  HLA-DQA1 LAG3      7.22
#> 2 B      CD8 T  HLA-DRA  LAG3      5.59
#> 3 B      CD8 T  HLA-DQB1 LAG3      5.59
#> 4 B      CD8 T  HLA-DQA2 LAG3      5.41
#> 5 B      CD8 T  HLA-DRB5 LAG3      5.26
#> 6 B      CD8 T  HLA-DRB1 LAG3      5.12
head(toy_exp)
#> # A tibble: 6 × 3
#> # Groups:   cell_type [1]
#>   cell_type gene   mean_exp
#>   <chr>     <chr>     <dbl>
#> 1 B         ACTR2    0.363 
#> 2 B         ADA      0.0170
#> 3 B         ADAM10   0.0833
#> 4 B         ADAM28   0.487 
#> 5 B         ADCY7    0.0336
#> 6 B         ADRB2    0.0178

3 Plot types

The package contains functions for making six types of plots: cc_heatmap, cc_dotplot, cc_network, cc_circos, cc_arrow and cc_sigmoid. Below are some examples of each plot type.

3.1 Heatmaps

The cc_heatmap function can generate heatmaps in four different styles. Option A just displays the total number of interactions between each pair of cell types and option B shows the ligands, receptors and cell types involved in each interaction as well as their score. For option B, only a small portion of top interactions are shown to avoid cluttering the plot. There is also an option to generate heatmaps in the style of popular cell-cell interaction prediction tools such as CellPhoneDB and Liana.

cc_heatmap(toy_data)

cc_heatmap(toy_data, option = "B", n_top_ints = 10)