Create network from cell-cell proximity scores

cellProximityNetwork(
  gobject,
  CPscore,
  remove_self_edges = FALSE,
  self_loop_strength = 0.1,
  color_depletion = "lightgreen",
  color_enrichment = "red",
  rescale_edge_weights = TRUE,
  edge_weight_range_depletion = c(0.1, 1),
  edge_weight_range_enrichment = c(1, 5),
  layout = c("Fruchterman", "DrL", "Kamada-Kawai"),
  only_show_enrichment_edges = FALSE,
  edge_width_range = c(0.1, 2),
  node_size = 4,
  node_color_code = NULL,
  node_text_size = 6,
  show_plot = NULL,
  return_plot = NULL,
  save_plot = NULL,
  save_param = list(),
  default_save_name = "cellProximityNetwork"
)

Arguments

gobject

giotto object

CPscore

CPscore, output from cellProximityEnrichment()

remove_self_edges

remove enrichment/depletion edges with itself

self_loop_strength

size of self-loops

color_depletion

color for depleted cell-cell interactions

color_enrichment

color for enriched cell-cell interactions

rescale_edge_weights

rescale edge weights (boolean)

edge_weight_range_depletion

numerical vector of length 2 to rescale depleted edge weights

edge_weight_range_enrichment

numerical vector of length 2 to rescale enriched edge weights

layout

layout algorithm to use to draw nodes and edges

only_show_enrichment_edges

show only the enriched pairwise scores

edge_width_range

range of edge width

node_size

size of nodes

node_color_code

color code for the nodes (e.g. cell labels)

node_text_size

size of node labels

show_plot

logical. show plot

return_plot

logical. return ggplot object

save_plot

logical. save the plot

save_param

list of saving parameters, see showSaveParameters

default_save_name

default save name for saving, don't change, change save_name in save_param

Value

igraph plot

Details

This function creates a network that shows the spatial proximity enrichment or depletion of cell type pairs.

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> cell_spatInfo_spatVector.shp
#> cell
#> 
#> 3.2 read Giotto spatial centroid information
#> cell
#> 
#> 3.3 read Giotto spatial overlap information
#> No overlaps were found, overlap loading will be
#>  skipped
#> 
#> 4. read Giotto image information
#> a giotto python environment was found
#> Using python path:
#>  "/Users/yuanlab/Library/r-miniconda/envs/giotto_env/bin/pythonw"

x <- cellProximityEnrichment(g, cluster_column = "leiden_clus")

cellProximityNetwork(gobject = g, CPscore = x)