library(SpaCCI)
library(nnls)
library(FNN)
library(Matrix)
#Load the example data
data(test_data)
gene_spot_df <- test_data$gene_spot_df
cell_prop_df <- test_data$cell_prop_df
spatial_coords_df <- test_data$spatial_coords_df
result <- LR_database(species = "Human",
database_name = "CellChat",
gene_spot_expression_dataframe = gene_spot_df)
# global
result_global <- run_SpaCCI(gene_spot_expression_dataframe = gene_spot_df,
spot_cell_proportion_dataframe = cell_prop_df,
spatial_coordinates_dataframe = spatial_coords_df,
LR_database_list = result,
analysis_scale = "global")
# local
result_local <- run_SpaCCI(gene_spot_expression_dataframe = gene_spot_df,
spot_cell_proportion_dataframe = cell_prop_df,
spatial_coordinates_dataframe = spatial_coords_df,
LR_database_list = result,
specific_LR_pair = "EDN1_EDNRA",
analysis_scale = "local",
local_scale_proportion = 0.1,
neighborhood_radius = 2.5)
Run the code above in your browser using DataLab