Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Time:2022-1-5

Hello, everyone, today we share a more important communication method, cellcall. The rule is very simple, that is, when we analyze the communication of single cells, does communication play a role??? Previous articles I sharedScmlnet for 10x single cell communication analysis (Communication Analysis of ligand receptor and TF, differential gene (target gene) network)Nichenet for 10x single cell (10x spatial transcriptome) communication analysisToday, we will analyze the ligand receptor and TF factor together to get the ligand receptor that really plays a role in communication and truly understand the communication between cells. Article inCellCall: integrating paired ligand–receptor and transcription factor activities for cell–cell communication, published in nuclear acids research on August 2, 2021, with an impact factor of 16 points.

Overview of CellCall

Cellcall is a tool to infer intercellular communication networks and internal regulatory signals by integrating intracellular and intercellular signals.
characteristic
  • 1. Cellcall collections ligand receiver transcript factor (l-r-tf) axis datasets based on KEGG pathways.

  • 2、 According to prior knowledge of L-R-TF interactions, CellCall infers intercellular communication by combining the expression of ligands/receptors and downstream TF activities for certain L-R pairs. (that is to get the ligand receptor pair that really works).

  • 3、CellCall embeds a pathway activity analysis method to identify the crucial pathways involved in communications between certain cell types. (this is also important, rising to the height of the passage).

  • 4、CellCall offers a rich suite of visualization options (Circos plot, Sankey plot, bubble plot, ridge plot, etc.) to intuitively present the analysis results. (visualization, final presentation).

The overview figure of CellCall is shown as follows.

Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
The analysis mode of ligand receiver transcript factor (l-r-tf) is very important and a big step forward than the original method.

Main functions of CellCall

CellCall provides a variety of functions including intercellular communication analysis, pathway activity analysis and a rich suite of visualization tools to intuitively present the results of the analysis (including Heatmap, Circos plot, Bubble plot, Sankey plot, TF enrichment plot and Ridge plot).

First, take a look at intercellular communication analysis

Load data (in other words, it is a matrix, and the analysis results of Seurat match RDS exactly)
The format of the input file is as follow table:
    1. The row names: gene symbols.
    1. The column names: cell IDs. The colnames can’t contain punctuation such as commas, periods, dashes, etc. Using underline to connect barcoder and cell type is recommended. Take the input format below as an example, the column name is made up of index and cell type. Users should set names.field=2 and names.delim=”_” in the function CreateNichConObject(). After that, cell type information is obtained and stored in the S4 object for later analysis. Because method in this paper depends on the cell type information, obtaining celltype information correctly is important.
    1. Other place: the expression values (counts or TPM) for a gene in a cell.
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Notice the line name here, with the cell type written.
Create object
 mt <- CreateNichConObject(data=data, min.feature = 3,
                            names.field = 2,
                            names.delim = "_",
                            source = "TPM",
                            scale.factor = 10^6,
                            Org = "Homo sapiens",
                            project = "Microenvironment")
Arguments
data A dataframe with row of gene and column of sample and the value must be numeric. Meanwhile what matters is that the colnames of dataframe should be in line with the paramter ‘names.delim’ and ‘names.field’, the former for pattern to splite every colnames, the latter for setting which index in splited colnames is cell type information. The function can get the ‘CELLTYPE’ information from the colnames ‘BARCODE_CLUSTER_CELLTYPE’ with names.delim=”_” and names.field=’3′, and then stored in slot meta.data of CreateNichCon. Cell type annotation from every cell is essential for scoring cell communication. If the colnames of data don’t coincide with the paramter ‘names.delim’ and ‘names.field’, CreateNichCon object may fail to create.
min.feature Include cells where enough features equalling min.feature are detected. It’s a preprocess which is the same as Seurat and set min.feature=0, if you don’t want to filter cell. This parameter depends on the sequencing technology of the input data.
names.delim Set the pattern to splite column name into vector. If the column name of the input matrix is BARCODE_CLUSTER_CELLTYPE, set names.delim=”_” to get CELLTYPE of BARCODE_CLUSTER_CELLTYPE with names.field=3.
names.field Set the index of column name vector which is splited by parameter names.delim to get cell type information. If the column name of the input matrix is BARCODE_CLUSTER_CELLTYPE, set names.field=3 to get CELLTYPE of BARCODE_CLUSTER_CELLTYPE with names.delim=”_”.
source The type of expression dataframe, eg “UMI”, “fullLength”, “TPM”, or “CPM”. When the source of input data is “TPM” or “CPM”, no transformation on the data. Otherwise, we transform the data to TPM with the parameter source=”fullLength” and to CPM with source=”UMI”.
scale.factor Sets the scale factor for cell-level normalization, default “10^6”, if the parameter is “UMI” or “fullLength”. Otherwise this parameter doesn’t work.
Org Set the species source of gene, eg “Homo sapiens”, “Mus musculus”. This parameter decides the paired ligand-receptor dataset and the transcript length which is needed in “TPM” transformation.
project Sets the project name for the CreateNichCon object.

Infer the cell-cell communication score

The communication score of an L-R interaction between cell types is evaluated by integrating the L2- norm of the L-R interaction and the activity score of the downstream TFs.
mt <- TransCommuProfile(object = mt,
                        pValueCor = 0.05,
                        CorValue = 0.1,
                        topTargetCor=1,
                        p.adjust = 0.05,
                        use.type="median",
                        probs = 0.9,
                        method="weighted",
                        IS_core = TRUE,
                        Org = 'Homo sapiens')

parameter analysis

Arguments Detail
object A Cellcall S4 object, the result of function CreateNichConObject().
pValueCor Set the threshold of spearson Correlation significance between target gene and TF, ( significance < pValueCor, default is 0.05 ).
CorValue Set the threshold of spearson Correlation Coefficient between target gene and TF, ( Coefficient > CorValue, default is 0.1 ).
topTargetCor Set the rank of candidate genes which has firlter by spearson Correlation, default is 1, that means 100% filtered candidate genes will be used.
p.adjust Set the threshold of regulons’s GSEA pValue which adjusted by Benjamini & Hochberg, default is 0.05.
use.type With parameter “median”, CellCall set the mean value of gene as zero, when the percentile of gene expression in one celltype below the parameter “probs”. The other choice is “mean” and means that we not concern about the percentile of gene expression in one celltype but directly use the mean value.
probs Set the percentile of gene expression in one celltype to represent mean value, when use.type=”median”.
method Choose the proper method to score downstream activation of all regulons of given ligand-receptor relation. Candidate values are “weighted”, “max”, “mean”, of which “weighted” is default.
Org Choose the dataset source of this project, eg “Homo sapiens”, “Mus musculus”.
IS_core Logical variable, whether use core reference LR data with high confidence or include extended datasets on the basis of core reference.

Pathway activity analysis

CellCall embeds a pathway activity analysis method to help explore the main pathways involved in communication between certain cells.
n <- [email protected]$expr_l_r_log2_scale

pathway.hyper.list <- lapply(colnames(n), function(i){
    print(i)
    tmp <- getHyperPathway(data = n, object = mt, cella_cellb = i, Org="Homo sapiens")
    return(tmp)
})
Arguments Detail
data A dataframe of communication score where row name is ligand-receptor and column names is cellA-cellB, stored in the data$expr_l_r_log2_scale slot of S4 object.
object A Cellcall S4 object, the result of function CreateNichConObject() and TransCommuProfile().
cella_cellb If explore the pathway enriched by paired ligand-receptor dataset between sender cellA and receiver cellB, user can set cella_cellb=”A-B”.
Org Choose the dataset source of this project, eg “Homo sapiens”, “Mus musculus”.
IS_core Logical variable, whether use core reference LR data with high confidence or include extended datasets on the basis of core reference.
For pathway activity analysis, Bubble plot is adopted to present the analysis results. Function of getForBubble is used to merge the data and plotBubble is used to draw the bubble plot.
myPub.df <- getForBubble(pathway.hyper.list, cella_cellb=colnames(n))
p <- plotBubble(myPub.df)
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

Final visualization

Circle plot
  cell_color <- data.frame(color=c('#e31a1c','#1f78b4',
                                   '#e78ac3','#ff7f00'), stringsAsFactors = FALSE)
  rownames(cell_color) <- c("SSC", "SPGing", "SPGed", "ST")
Plotting circle with CellCall object:
ViewInterCircos(object = mt, font = 2, cellColor = cell_color, 
                lrColor = c("#F16B6F", "#84B1ED"),
                arr.type = "big.arrow",arr.length = 0.04,
                trackhight1 = 0.05, slot="expr_l_r_log2_scale",
                linkcolor.from.sender = TRUE,
                linkcolor = NULL, gap.degree = 2,
                order.vector=c('ST', "SSC", "SPGing", "SPGed"),
                trackhight2 = 0.032, track.margin2 = c(0.01,0.12), DIY = FALSE)
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Plotting circle with DIY dataframe of [email protected]$expr_l_r_log2_scale:
  ViewInterCircos(object = [email protected]$expr_l_r_log2_scale, font = 2, 
                  cellColor = cell_color,
                  lrColor = c("#F16B6F", "#84B1ED"),
                  arr.type = "big.arrow",arr.length = 0.04,
                  trackhight1 = 0.05, slot="expr_l_r_log2_scale",
                  linkcolor.from.sender = TRUE,
                  linkcolor = NULL, gap.degree = 2,
                  order.vector=c('ST', "SSC", "SPGing", "SPGed"),
                  trackhight2 = 0.032, track.margin2 = c(0.01,0.12), DIY = T)
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Pheatmap plot
viewPheatmap(object = mt, slot="expr_l_r_log2_scale", show_rownames = T,
             show_colnames = T,treeheight_row=0, treeheight_col=10,
             cluster_rows = T,cluster_cols = F,fontsize = 12,angle_col = "45",  
             main="score")
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

Sankey plot

  mt <- LR2TF(object = mt, sender_cell="ST", recevier_cell="SSC",
              slot="expr_l_r_log2_scale", org="Homo sapiens")
  head([email protected]$sankey)
 if(!require(networkD3)){
        BiocManager::install("networkD3")
  }
  
  sank <- LRT.Dimplot(mt, fontSize = 8, nodeWidth = 30, height = NULL, width = 1200,         
                      sinksRight=FALSE, DIY.color = FALSE)
  networkD3::saveNetwork(sank, "~/ST-SSC_full.html")
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

The first pillar is ligand,the second pillar is receptor and the last pillar is TF. And the color of left and right flow are consistent with ligand and TF respectively.

Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

The color depends on ligand and receptor (by function sankey_graph with isGrandSon = FALSE)

library(magrittr)
library(dplyr)
tmp <- [email protected]$sankey
tmp1 <- dplyr::filter(tmp, weight1>0) ## filter triple relation with weight1 (LR score)
tmp.df <- trans2tripleScore(tmp1)  ## transform weight1 and weight2 to one value (weight)
head(tmp.df)

## set the color of node in sankey graph
mycol.vector = c('#5d62b5','#29c3be','#f2726f','#62b58f','#bc95df', '#67cdf2', '#ffc533', '#5d62b5', '#29c3be')  
elments.num <-  tmp.df %>% unlist %>% unique %>% length()
mycol.vector.list <- rep(mycol.vector, times=ceiling(elments.num/length(mycol.vector)))
sankey_graph(df = tmp.df, axes=1:3, mycol = mycol.vector.list[1:elments.num], nudge_x = NULL, font.size = 4, boder.col="white", isGrandSon = F)

The first pillar is ligand,the second pillar is receptor and the last pillar is TF. And the color of left and right flow are consistent with ligand and receptor respectively.

Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

The color depends on ligand (by function sankey_graph with isGrandSon = TRUE)

library(magrittr)
library(dplyr)
tmp <- [email protected]$sankey
tmp1 <- dplyr::filter(tmp, weight1>0)  ## filter triple relation with weight1 (LR score)
tmp.df <- trans2tripleScore(tmp1)  ## transform weight1 and weight2 to one value (weight)

## set the color of node in sankey graph
mycol.vector = c('#9e0142','#d53e4f','#f46d43','#fdae61','#fee08b','#e6f598','#abdda4','#66c2a5','#3288bd','#5e4fa2')
elments.num <-  length(unique(tmp.df$Ligand))
mycol.vector.list <- rep(mycol.vector, times=ceiling(elments.num/length(mycol.vector)))

sankey_graph(df = tmp.df, axes=1:3, mycol = mycol.vector.list[1:elments.num], 
             isGrandSon = TRUE, nudge_x = nudge_x, font.size = 2, boder.col="white",            
             set_alpha = 0.8)

The first pillar is ligand,the second pillar is receptor and the last pillar is TF. And the color of left and right flow are consistent with ligand.

Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

TF enrichment plot

TF enrichment plot is adopted to present the TF activities in receiver cells.

Obtain the gene sets (TGs of TF):

For some biologists, they pay more attention to the TGs of the TF. This tool provide options to present or export the details of the TG list, stored in the [email protected][email protected]

[email protected][email protected]

The figure presents a part of result stored in the [email protected][email protected]

Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

Show all TFs in the SSC:

  ssc.tf <- names([email protected][email protected])
  ssc.tf
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

Draw the TF enrichment plot:

getGSEAplot([email protected]$gsea.list, geneSetID=c("CREBBP", "ESR1", "FOXO3"), 
            myCelltype="SSC", [email protected]$fc.list,  
            selectedGeneID = [email protected][email protected]$CREBBP[1:10],
            mycol = NULL)
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

Ridge plot

Ridge plot is adopted to present FC distribution of TGs of activated TFs.

## gsea object
egmt <- [email protected]$gsea.list$SSC

## filter TF
egmt.df <- data.frame(egmt)
head(egmt.df[,1:6])
flag.index <- which(egmt.df$p.adjust < 0.05)

ridgeplot.DIY(x=egmt, fill="p.adjust", showCategory=flag.index, core_enrichment = T,
                orderBy = "NES", decreasing = FALSE)

Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png
Communication analysis of ligand receptor combined with TF factor in 10x single cell (10x spatial transcriptome)

Picture png

Life is good, it’s better to have you

Recommended Today

Redis Client On Error: Error: write ECONNABORTED Config right

Solve the redis client on error: error: write econnaborted config rightwe Problem Description: Solution: 1. First, check whether the firewall of Linux is turned on Turn off the firewall [[email protected]]# systemctl stop firewalld.service Open 6379 port number [[email protected]]# sudo firewall-cmd –zone=public –add-port=6379/tcp –permanent success [[email protected]]# sudo firewall-cmd –reload success 2. Check whether the redis startup […]