Skip to contents

Plot celltype fraction comparison

Usage

plot_comparison(
  spe,
  cell_type_1 = NULL,
  cell_type_2 = NULL,
  palette = "Blue-Red",
  transform_scale = NULL,
  sample_id = "sample01",
  image_id = "lowres",
  reverse_palette = FALSE,
  background = NULL,
  zoom = TRUE,
  show_image = FALSE,
  offset_rotation = FALSE,
  spot_size = 1,
  limits = NULL,
  smooth = FALSE,
  smoothing_factor = 1.5,
  title_size = 30,
  title = NULL,
  font_size = 15,
  legend_size = 20,
  palette_type = "diverging",
  density = TRUE,
  save = FALSE,
  path = NULL,
  png_width = 1500,
  png_height = 750,
  show_legend = TRUE,
  ...
)

Arguments

spe

deconvolution result in Form of a SpatialExperiment

cell_type_1

celltype to plot

cell_type_2

celltype to plot

palette

colorspace palette (sequential)

transform_scale

data transform_scaleation to use, "log"

sample_id

sample id to plot, default: "sample01"

image_id

which image to plot, default: "lowres"

reverse_palette

reverse color palette

background

custom background color

zoom

zoom to the available spots

show_image

logical, wether to display the image, default = TRUE

offset_rotation

correct hex orientation for rotated visium image

spot_size

increase (>1) or decrease (<1) the hex size

limits

vector of color scale limits

smooth

whether to smooth the plot

smoothing_factor

kernel size factor (multiples of spot distance)

title_size

font size of title

title

set a custom title

font_size

font size of legend

legend_size

legend size in points

palette_type

"discrete", "sequenatial", "diverging"

density

whether to display a density distribution next to the spatial plot

save

set TRUE to save plot

path

specify directory to save plot, if NULL: saving at ~/spacedeconv

png_width

when saving, png width in px

png_height

when saving, png height in px

show_legend

whether to show the legend

...

additional paramters passed to internal functions

Value

plot of a celltypes presence/absence using a threshold