Learn R Programming

SpaCCI (version 1.0.4)

plot_SpaCCI_local_Strength: Plot SpaCCI Localized Interaction Strength Results

Description

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

Usage

plot_SpaCCI_local_Strength(
  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
)

Value

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

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.

Examples

Run this code
# Plot localized SpaCCI results using Seurat object
library(SpaCCI)
library(dplyr)
data(result_local)
data(result_local_spatial_coords_df)
spatial_coords_df <- result_local_spatial_coords_df
#plot_SpaCCI_local(Seurat_Object = seurat_object,.....)

# Plot localized SpaCCI results using spatial coordinates
plot_SpaCCI_local_Strength(spatial_coordinates_dataframe = spatial_coords_df,
                           SpaCCI_local_Result_List = result_local,
                           Ligand_cell_type = "ductal",
                           Receptor_cell_type = "activated_stellate",
                           spot_plot_size = 3)

Run the code above in your browser using DataLab