SpicyResults-class {spicyR} | R Documentation

## Performs spatial tests on spatial cytometry data.

### Description

Performs spatial tests on spatial cytometry data.

### Usage

    spicy(
      cells,
      condition = NULL,
      subject = NULL,
      covariates = NULL,
      from = NULL,
      to = NULL,
      dist = NULL,
      integrate = TRUE,
      nsim = NULL,
      verbose = TRUE,
      ...
    )

### Arguments

`cells` | A SegmentedCells or data frame that contains at least the variables x and y, giving the location coordinates of each cell, and cellType.
`condition` | Vector of conditions to be tested corresponding to each image if cells is a data frame.
`subject` | Vector of subject IDs corresponding to each image if cells is a data frame.
`covariates` | Vector of covariate names that should be included in the mixed effects model as fixed effects.
`from` | vector of cell types which you would like to compare to the to vector
`to` | vector of cell types which you would like to compare to the from vector
`dist` | The distance at which the statistic is obtained.
`integrate` | Should the statistic be the integral from 0 to dist, or the value of the L curve at dist.
`nsim` | Number of simulations to perform. If empty, the p-value from lmerTest is used.
`verbose` | logical indicating whether to output messages.
`...` | Other options to pass to bootstrap.

### Value

Data frame of p-values.

### Examples

    data("melanomaResponders")

    # Test with random effect for patient on only one pairwise combination of cell types.
    spicy(melanomaResponders, condition = "condition", subject = "subject",
          from = "CD8+PD1+PDL1-", to = "CD8-PD1+PDL1+")

    # Test all pairwise combination of cell types without random effect of patient.
    #spicyTest <- spicy(melanomaResponders, condition = "condition")

    # Test all pairwise combination of cell types with random effect of patient.
    #spicy(melanomaResponders, condition = "condition", subject = "subject")

    # Test all pairwise combination of cell types with random effect of patient using
    # a bootstrap to calculate significance.
    #spicy(melanomaResponders, condition = "condition", subject = "subject", nsim = 199)

[Package spicyR version 0.99.13 Index]