plot_SpaCCI_local {SpaCCI}R Documentation

Plot SpaCCI Localized Interaction Results

Description

This function provides a unified interface to visualize the localized cell-cell interaction patterns inferred by SpaCCI, either using a Seurat object with a spatial image or a spatial coordinates data frame.

Usage

plot_SpaCCI_local(
  Seurat_Object = NULL,
  spatial_coordinates_dataframe = NULL,
  SpaCCI_local_Result_List,
  Ligand_cell_type,
  Receptor_cell_type,
  spot_plot_size,
  specific_LR_pair_name = NULL,
  significant_cutoff = 0.05
)

Arguments

Seurat_Object

Optional. A Seurat object containing spatial data. If provided, the function will plot the interaction patterns on the tissue image.

spatial_coordinates_dataframe

Optional. A data frame containing the spatial coordinates of the spots. The columns should include "Spot_ID", "imagerow", and "imagecol". The row names must be the names of "Spot_ID", matching those in the cell type proportion data frame or the gene expression data frame.

SpaCCI_local_Result_List

A list containing the results from a SpaCCI local analysis. This list should include dataframelist and RegionIDs_matrix, which are the outputs from run_SpaCCI(..., analysis_scale = "local",...).

Ligand_cell_type

The name of the ligand cell type to plot. This should match the cell type names used in the run_SpaCCI analysis.

Receptor_cell_type

The name of the receptor cell type to plot. This should match the cell type names used in the run_SpaCCI analysis.

spot_plot_size

A numeric value controlling the size of the spots in the plot.

specific_LR_pair_name

Optional. The name of a specific ligand-receptor pair to plot. If provided, the plot will focus on this interaction. The name should match those in the SpaCCI_local_Result_List$dataframelist.

significant_cutoff

A numeric value specifying the significance cutoff for the adjusted P-values from the permutation test. Default is 0.05.

Value

A plot object showing the localized interaction patterns. The plot will be generated using either the Seurat object or the spatial coordinates data frame, depending on the input provided.

Examples

# Plot localized SpaCCI results using Seurat object
library(SpaCCI)
data(result_local)
data(test_data)
spatial_coords_df <- test_data$spatial_coords_df
#plot_SpaCCI_local(Seurat_Object = seurat_object,.....)

# Plot localized SpaCCI results using spatial coordinates
plot_SpaCCI_local(spatial_coordinates_dataframe = spatial_coords_df,
                  SpaCCI_local_Result_List = result_local,
                  Ligand_cell_type = "beta",
                  Receptor_cell_type = "delta",
                  spot_plot_size = 3)


[Package SpaCCI version 1.0.2 Index]