This function compares feature counts across multiple STGrid objects.
A set of STGrid objects.
A character vector specifying the features (e.g., genes) to compare. Default is NULL.
Logical indicating whether the counts should be normalized. Default is FALSE.
Type of plot to generate. Currently only barplot is supported.
Optional character vector specifying names for each STGrid object. If NULL, default names will be assigned.
Transformation method for the counts. Options are "None" (default), "log2", "log10", or "log".
Optional character vector specifying fill colors for different conditions in the plot.
Color for the border of bars in bar plots. Default is "black".
A ggplot object representing the comparison of counts across different conditions or samples.
example_dataset()
#> |-- INFO : Dataset 11284233/files/Xenium_Mouse_Brain_Coronal_7g was already loaded.
xen <- Xenium_Mouse_Brain_Coronal_7g
x_bins <- bin_x(xen)[181:nbin_x(xen)]
y_bins <- bin_y(xen)[101:nbin_y(xen)]
xen_r1 <- xen[x_bins, y_bins]
x_bins <- bin_x(xen)[61:101]
y_bins <- bin_y(xen)[101:nbin_y(xen)]
xen_r2 <- xen[x_bins, y_bins]
cmp_counts_st(xen, xen_r1, xen_r2, features = c("Chat", "Ano1"), normalized = FALSE)
#> |-- INFO : Found 3 STGrid objects.
cmp_counts_st(xen, xen_r1, xen_r2,
features = c("Chat", "Ano1"),
normalized = TRUE, fill_color=grDevices::rainbow(3))
#> |-- INFO : Found 3 STGrid objects.