Plotting CellPhoneDB results as a chord diagram

plot_cpdb3(
  scdata,
  cell_type1,
  cell_type2,
  celltype_key,
  means,
  pvals,
  deconvoluted,
  keep_significant_only = TRUE,
  splitby_key = NULL,
  standard_scale = TRUE,
  gene_symbol_mapping = NULL,
  frac = 0.1,
  remove_self = TRUE,
  desiredInteractions = NULL,
  degs_analysis = FALSE,
  directional = 1,
  alpha = 0.5,
  edge_colors = NULL,
  grid_colors = NULL,
  show_legend = TRUE,
  legend.pos.x = 20,
  legend.pos.y = 20,
  ...
)

Arguments

scdata

single-cell data. Must be a SingleCellExperiment object.

cell_type1

cell type 1

cell_type2

cell type 2

celltype_key

vector holding the celltype_key for each cell or column name of scdata's metadata. MUST match cpdb's columns

means

object holding means.txt from cpdb output

pvals

object holding pvals.txt from cpdb output

deconvoluted

object holding deconvoluted.txt from cpdb output

keep_significant_only

logical. Default is FALSE. Switch to TRUE if you only want to plot the significant hits from cpdb.

splitby_key

column name in the metadata/coldata table to split the spots by. Can only take columns with binary options. If specified, name to split by MUST be specified in the meta file provided to cpdb prior to analysis.

standard_scale

logical. scale the expression to range from 0 to 1. Default is TRUE

gene_symbol_mapping

default = NULL.column name for rowData in sce holding the actual gene symbols if row names aren't gene symbols

frac

default = 0.1. Minimum fraction of celtypes expressing a gene in order to keep the interaction. Gene must be expressesd >= `frac` in either of the pair of celltypes in order to keep.

remove_self

default = TRUE. Remove self-self arcs.

desiredInteractions

default = NULL. Specific list of celltype comparisons e.g. list(c('CD4_Tcm', 'cDC1'), c('CD4_Tcm', 'cDC2')). Also accepts a dataframe where first column is celltype 1 and 2nd column is celltype 2.

degs_analysis

if is CellPhoneDB degs_analysis mode.

directional

Whether links have directions. 1 means the direction is from the first column in df to the second column, -1 is the reverse, 0 is no direction, and 2 for two directional.

alpha

transparency for links

edge_colors

vector of colors for links

grid_colors

vector of colors for grids

show_legend

whether or not to show the legend

legend.pos.x

x position of legend

legend.pos.y

y position of legend

...

passes arguments plot_cpdb

Value

Plotting CellPhoneDB results as a CellChat inspired chord diagram

Examples

# \donttest{

# }