scHOT_estimatePvalues: scHOT_estimatePvalues

Description Usage Arguments Value Examples

View source: R/scHOT_functions.R

Description

Estimate p-values based on already run permutation tests

Usage

1
2
3
4
5
6
7
8
scHOT_estimatePvalues(
  scHOT,
  usenperm_estimate = FALSE,
  nperm_estimate = 10000,
  maxDist = 0.1,
  plot = FALSE,
  verbose = FALSE
)

Arguments

scHOT

A scHOT object

usenperm_estimate

Logical (default FALSE) if number of neighbouring permutations should be used, or if difference of global higher order statistic should be used

nperm_estimate

Number of neighbouring permutations to use for p-value estimation

maxDist

max difference of global higher order statistic to use for p-value estimation (default 0.1)

plot

A logical input indicating whether the results are plotted

verbose

A logical input indicating whether the intermediate steps will be printed

Value

scHOT A scHOT object with results stored in scHOT_output slot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 data(MOB_subset)
 sce_MOB_subset <- MOB_subset$sce_MOB_subset
 scHOT_spatial <- scHOT_buildFromSCE(sce_MOB_subset,
                                     assayName = "logcounts",
                                    positionType = "spatial",
                                     positionColData = c("x", "y"))
pairs <- matrix(c("Arrb1", "Mtor", "Dnm1l", "Gucy1b3"), ncol = 2, byrow = TRUE)
rownames(pairs) <- apply(pairs,1,paste0,collapse = "_")

scHOT_spatial <- scHOT_addTestingScaffold(scHOT_spatial, pairs)

scHOT_spatial <- scHOT_setWeightMatrix(scHOT_spatial,
                                       positionColData = c("x","y"),
                                        positionType = "spatial",
                                        nrow.out = NULL,
                                        span = 0.05)
scHOT_spatial <- scHOT_calculateGlobalHigherOrderFunction(
  scHOT_spatial,
  higherOrderFunction = weightedSpearman,
  higherOrderFunctionType = "weighted")
scHOT_spatial <- scHOT_setPermutationScaffold(scHOT_spatial,
                                              numberPermutations = 100)
scHOT_spatial <- scHOT_calculateHigherOrderTestStatistics(
  scHOT_spatial,
  higherOrderSummaryFunction = sd)

scHOT_spatial <- scHOT_performPermutationTest(
  scHOT_spatial,
  verbose = TRUE,
  parallel = FALSE)

scHOT_spatial <- scHOT_estimatePvalues(scHOT_spatial)

scHOT documentation built on Nov. 8, 2020, 5:06 p.m.