Create a STCompR compare class to compare two sets of STGrid objects. By default differential expression is performed with DESeq2. If only one sample of each classe is provided, a Fisher's exact test is performed.

stcompr(
  object_1,
  object_2,
  name_1 = "Condition_1",
  name_2 = "Condition_2",
  fit_type = c("local", "mean", "parametric", "glmGamPoi"),
  p_adj_method = c("BH", "holm", "hochberg", "hommel", "bonferroni", "BY", "fdr", "none"),
  pseudo_count = 1
)

Arguments

object_1

A STGrid object.

object_2

A STGrid object.

name_1

A string to name classe 1.

name_2

A string to name classe 2.

fit_type

See estimateDispersions() in DESeq2 library.

p_adj_method

The pvalue correction method. See stats::p.adjust.

pseudo_count

A pseudo-count value to be stored in the object.

Value

An object of class 'STCompR'.

Examples

# Example usage:
example_dataset()
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 <- stcompr(list(xen_r1=xen_r1), list(xen_r2=xen_r2))