netVisual_bubble: Show all the significant interactions (L-R pairs) from some...

View source: R/visualization.R

netVisual_bubbleR Documentation

Show all the significant interactions (L-R pairs) from some cell groups to other cell groups

Description

The dot color and size represent the calculated communication probability and p-values.

Usage

netVisual_bubble(
  object,
  sources.use = NULL,
  targets.use = NULL,
  signaling = NULL,
  pairLR.use = NULL,
  sort.by.source = FALSE,
  sort.by.target = FALSE,
  sort.by.source.priority = TRUE,
  color.heatmap = c("Spectral", "viridis"),
  n.colors = 10,
  direction = -1,
  thresh = 0.05,
  comparison = NULL,
  group = NULL,
  remove.isolate = FALSE,
  max.dataset = NULL,
  min.dataset = NULL,
  min.quantile = 0,
  max.quantile = 1,
  line.on = TRUE,
  line.size = 0.2,
  color.text.use = TRUE,
  color.text = NULL,
  title.name = NULL,
  font.size = 10,
  font.size.title = 10,
  show.legend = TRUE,
  grid.on = TRUE,
  color.grid = "grey90",
  angle.x = 90,
  vjust.x = NULL,
  hjust.x = NULL,
  return.data = FALSE
)

Arguments

object

CellChat object

sources.use

a vector giving the index or the name of source cell groups

targets.use

a vector giving the index or the name of target cell groups.

signaling

a character vector giving the name of signaling pathways of interest

pairLR.use

a data frame consisting of one column named either "interaction_name" or "pathway_name", defining the interactions of interest and the order of L-R on y-axis

sort.by.source, sort.by.target, sort.by.source.priority

set the order of interacting cell pairs on x-axis; please check examples for details

color.heatmap

A character string or vector indicating the colormap option to use. It can be the avaibale color palette in viridis_pal() or brewer.pal()

n.colors

number of basic colors to generate from color palette

direction

Sets the order of colors in the scale. If 1, the default colors are used. If -1, the order of colors is reversed.

thresh

threshold of the p-value for determining significant interaction

comparison

a numerical vector giving the datasets for comparison in the merged object; e.g., comparison = c(1,2)

group

a numerical vector giving the group information of different datasets; e.g., group = c(1,2,2)

remove.isolate

whether remove the entire empty column, i.e., communication between certain cell groups

max.dataset

a scale, keep the communications with highest probability in max.dataset (i.e., certrain condition)

min.dataset

a scale, keep the communications with lowest probability in min.dataset (i.e., certrain condition)

min.quantile, max.quantile

minimum and maximum quantile cutoff values for the colorbar, may specify quantile in [0,1]

line.on

whether add vertical line when doing comparison analysis for the merged object

line.size

size of vertical line if added

color.text.use

whether color the xtick labels according to the dataset origin when doing comparison analysis

color.text

the colors for xtick labels according to the dataset origin when doing comparison analysis

title.name

main title of the plot

font.size, font.size.title

font size of all the text and the title name

show.legend

whether show legend

grid.on, color.grid

whether add grid

angle.x, vjust.x, hjust.x

parameters for adjusting the rotation of xtick labels

return.data

whether return the data.frame for replotting

Examples

## Not run: 
# show all the significant interactions (L-R pairs) from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:11), remove.isolate = FALSE)

# show all the significant interactions (L-R pairs) associated with certain signaling pathways
netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:11), signaling = c("CCL","CXCL"))

# show all the significant interactions (L-R pairs) based on user's input (defined by `pairLR.use`; the order of L-R is also based on user's input)
pairLR.use <- extractEnrichedLR(cellchat, signaling = c("CCL","CXCL","FGF"))
netVisual_bubble(cellchat, sources.use = c(3,4), targets.use = c(5:8), pairLR.use = pairLR.use, remove.isolate = TRUE)

# set the order of interacting cell pairs on x-axis
# (1) Default: first sort cell pairs based on the appearance of sources in levels(object@idents), and then based on the appearance of targets in levels(object@idents)
# (2) sort cell pairs based on the targets.use defined by users
netVisual_bubble(cellchat, targets.use = c("LC","Inflam. DC","cDC2","CD40LG+ TC"), pairLR.use = pairLR.use, remove.isolate = TRUE, sort.by.target = T)
# (3) sort cell pairs based on the sources.use defined by users
netVisual_bubble(cellchat, sources.use = c("FBN1+ FIB","APOE+ FIB","Inflam. FIB"), pairLR.use = pairLR.use, remove.isolate = TRUE, sort.by.source = T)
# (4) sort cell pairs based on the sources.use and then targets.use defined by users
netVisual_bubble(cellchat, sources.use = c("FBN1+ FIB","APOE+ FIB","Inflam. FIB"), targets.use = c("LC","Inflam. DC","cDC2","CD40LG+ TC"), pairLR.use = pairLR.use, remove.isolate = TRUE, sort.by.source = T, sort.by.target = T)
# (5) sort cell pairs based on the targets.use and then sources.use defined by users
netVisual_bubble(cellchat, sources.use = c("FBN1+ FIB","APOE+ FIB","Inflam. FIB"), targets.use = c("LC","Inflam. DC","cDC2","CD40LG+ TC"), pairLR.use = pairLR.use, remove.isolate = TRUE, sort.by.source = T, sort.by.target = T, sort.by.source.priority = FALSE)

# show all the increased interactions in the second dataset compared to the first dataset
netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:8), remove.isolate = TRUE, max.dataset = 2)

# show all the decreased interactions in the second dataset compared to the first dataset
netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:8), remove.isolate = TRUE, max.dataset = 1)

## End(Not run)

sqjin/CellChat documentation built on Nov. 10, 2023, 4:29 a.m.