Skip to contents

Draws a spatial scatter plot from cnv_obj@cluster, coloring points by clone label. Optionally flips the axes with coord_flip().

Usage

spatialplot(
  cnv_obj,
  colors = c("#ebe5c2", "#D57358", "#8a508f", "#023047", "#E64B35", "#4DBBD5", "#00A087",
    "#3C5488", "#F39B7F", "#8491B4", "#91D1C2", "#DC0000", "#7E6148", "#B09C85"),
  point_size = 0.01,
  use_x_reverse = FALSE,
  use_coord_flip = FALSE,
  title = ""
)

Arguments

cnv_obj

highSpaClone object.

colors

Character vector of hex/color names used for clusters.

point_size

Numeric point size passed to geom_point().

use_x_reverse

Logical; if TRUE, reverses the x-axis direction (i.e., flips the plot horizontally). This option is useful when the spatial coordinates are mirrored relative to the original histology image or when you want to align the orientation with external annotations. Default is FALSE.

use_coord_flip

Logical; if TRUE, flips the coordinate axes (useful when the image orientation requires rotation). Default is FALSE.

title

Character plot title.

Examples

if (FALSE) { # \dontrun{
p <- spatialplot(cnv_obj,
                 point_size = 0.01,
                 use_x_reverse = T,
                 use_coord_flip = T,
                 title = "Tumor subclones")
print(p)
} # }