visualize_spatial_gradient {STDistance} | R Documentation |
Visualize spatial network with expression gradient
Description
Visualize spatial network with expression gradient
Usage
visualize_spatial_gradient(
spatial_data,
sample,
gradient_type,
fixed_type,
expression_col = "gen2_SPLIz_numeric",
x_col = "pxl_row_in_fullres",
y_col = "pxl_col_in_fullres",
type_col = "Epi_strom",
fixed_color = "#A9C6D9",
line_color = "#666666",
gradient_palette = "C",
point_size = 1,
point_alpha = 0.8,
line_width = 0.3,
line_alpha = 0.6,
show_legend = TRUE,
legend_title = "Expression",
grid_major_color = "gray90",
grid_minor_color = "gray95",
border_color = "black",
background_color = "white"
)
Arguments
spatial_data |
Spatial coordinates data frame containing cell types and expression values |
sample |
Sample name in the spatial transcriptome data |
gradient_type |
Cell type to show with expression gradient coloring |
fixed_type |
Cell type to show in fixed color (default gray) |
expression_col |
Column name containing expression values (default "gen2_SPLIz_numeric") |
x_col |
Column name for x-coordinates (default "pxl_row_in_fullres") |
y_col |
Column name for y-coordinates (default "pxl_col_in_fullres") |
type_col |
Column name for cell type information (default "Epi_strom") |
fixed_color |
Color for the fixed cell type (default "#A9C6D9" - light gray-blue) |
line_color |
Color for connection lines (default "#666666" - dark gray) |
gradient_palette |
Color palette for expression gradient (default viridis option "C") |
point_size |
Size of points (default 1) |
point_alpha |
Transparency of points (default 0.8) |
line_width |
Width of connection lines (default 0.3) |
line_alpha |
Transparency of connection lines (default 0.6) |
show_legend |
Logical whether to show legend (default TRUE) |
legend_title |
Title for the legend (default "Expression") |
grid_major_color |
Color for major grid lines (default "gray90") |
grid_minor_color |
Color for minor grid lines (default "gray95") |
border_color |
Color for plot border (default "black") |
background_color |
Color for plot background (default "white") |
Value
A ggplot object showing the spatial relationships with expression gradient
Examples
visualize_spatial_gradient(spatial_data = posi,
sample="SP8",
gradient_type = "Epithelial_cells_A",
fixed_type = "Macrophage",
expression_col = "gen2_SPLIz_numeric",
type_col = "celltype_ABCDepi",
legend_title = "Expression",
background_color = "white")