R/Spatial_celltype_plot.R
Spatial_celltype_plot.Rd
Plotting celltype assign to cell according to their phenotype on the spatial image.
Character vector containing the name of the sample.
Data frame containing imagerow, imagecol and barcode of the cells belonging to the spatial image. It can also be created by the function scaling_spatial_image_parameter by selecting the output parameter 10.
Tbl-df containing the sample name, grob, height and width of the spatial image. It can also be created by the function scaling_spatial_image_parameter by selecting the output parameter 5.
Data frame containing GEX information (VGM[[2]]). It must have a barcode column containing GEX_barcode and a cell.state column (output from GEX_phenotype).
Character vector to name the plot.
Number, to define the size of the text, default = 15.
Character vector to name the legend scale.
Booleans, if TRUE the unclassified cells are also plot and if FALSE they aren't plot exept if the parameter specific_celltype = "Unclassified". In this case the unclassified cells are displayed even unclassified_cells = FALSE. Default = FALSE.
Character vector, the user can choose to express a specific celltype like T, B or Unclassified cells. Default = No.
Booleans, if TRUE a density map is made. Default = FALSE
Returns a ggplot of the celltypes and if density = TRUE a density map of the cells on the spatial image.
if (FALSE) {
Spatial_celltype_plot(bcs_merge = scaling_parameters[[10]],
vgm_GEX = vgm_spatial$GEX@meta.data,images_tibble = scaling_parameters[[5]],
sample_names = sample_names,title="B and T celltype", legend_title = "Celltype",
unclassified_cells = FALSE, specific_celltype = "Unclassified")
}