NEWS
spicyR 1.99.17
- spicy() with several radii finds every cell's neighbours once, at the largest radius, and counts them for each
radius from that one search. Results are identical; an omnibus over 25 radii takes about 4 times less time.
spicyR 1.99.16
- R-level parallel loops (method = "image" with sigma or a concave window, weightsByPair, survival models) run
on BiocParallel instead of parallel::mclapply: forked workers start once per call and share the data,
tasks are handed out in about eight chunks per worker, and socket workers are used on Windows. BLAS and
OpenMP run one thread in each worker during the call; OpenBLAS otherwise starts one thread per core in
every worker, and forked workers can hang after the session has used several OpenMP threads.
BiocParallel and RhpcBLASctl are imported; parallel is no longer imported.
spicyR 1.99.15
- spicy(combine = "davies") combines many radii by Davies' (1987) bound for the maximum of the standardised
effect over the radii, from the same per-radius tests and sandwich correlations as the max-T. It allows a fine
grid of radii; combine = "maxT" now stops with a message for more than six radii.
spicyR 1.99.14
- spicy(weightsByPair = TRUE) no longer fails for a cell type paired with itself: both terms of the weight
model have the same covariate, so it is fitted as one monotone smooth, which gives the predictions scam()
gives for the two-term model.
spicyR 1.99.13
- spicy() fits one model for the cell method: the patient frailty and the image random effect, without the
label-clustering inflation. The arguments frailty, labelClustering and imageHeterogeneity are removed, and
variance = "auto" is removed: the variance is CR2 on Satterthwaite df for every study size unless
variance = "hartung_knapp" is given.
spicyR 1.99.12
- Cell method: images within a patient now have their own random effect (imageHeterogeneity = TRUE, the
default). Each image is weighted by 1 / (its sampling variance + the between-image variance), with the
between-image variance estimated by DerSimonian-Laird from the spread within patients and reported as
tau2_image, so one large image can no longer outweigh a patient's other images. With one image per patient
the results are unchanged.
spicyR 1.99.11
- Concave windows (method = "image", window = "concave") are computed by a C++ port of concaveman, which
gives the same polygon as concaveman::concaveman(); concaveman is no longer suggested.
spicyR 1.99.10
- New buildKnnGraph(): the k-nearest-neighbour graph between the cells of each image, from the C++ core,
stored as a colPair for convPairs(). It gives the same graph as imcRtools::buildSpatialGraph(type =
"knn"), so imcRtools is no longer suggested; pkgdown is no longer suggested either.
spicyR 1.99.9
- Vignette: the numbers quoted in the text are computed from the results, and the statements about them
are checked when the vignette is built. The shuffled-label check uses 10 shuffles.
spicyR 1.99.8
- spicy(labelClustering = ) defaults to FALSE: the within-image variance is no longer inflated for
'to' cells that cluster among themselves unless asked for.
spicyR 1.99.7
- spicy(variance = ) defaults to "cr2" again (CR2 on Satterthwaite df). "auto" (the Hartung-Knapp
variance when a condition has at most 5 patients, CR2 otherwise) remains available as an option.
spicyR 1.99.6
- The allocation effect is now scaled on two sides. A pair whose 'to' cells avoid the 'from' cells (fewer
'to' cells with a 'from' cell within r than expected, summed over all images, without the conditions)
uses (observed share - q) / q, the fraction of the 'to' cells that would have a 'from' cell nearby that
were moved away; an attracting pair keeps (observed share - q) / (1 - q). Before, avoidance used the
attraction scale, on which the effect of a fixed avoidance grows with q, i.e. with how many 'from'
cells there are and how densely they are packed, and is unbounded below as q approaches 1. The
results gain a 'side' column ("attract" or "avoid").
- spicy(variance = ) gains "auto", the new default: the Hartung-Knapp variance on m - 2 df when a
condition has at most 5 patients (CR2's Satterthwaite df are then very small), CR2 otherwise. The
variance used is returned in $variance.
spicyR 1.99.5
- The cell method's default effect is the allocation effect (effect = "allocation"): the extra fraction
of 'to' cells with at least one 'from' cell within r, (observed share - q) / (1 - q), q its exact
expectation under random labelling. If a fraction f of the 'to' cells is moved next to 'from' cells,
the effect is f, however many 'from' cells there are and however densely they are packed. The count
excess of earlier versions (extra 'from' cells per 'to' cell) is effect = "count"; it grows with how
densely the 'from' cells are packed, so a change in packing alone can appear as a change in
co-localisation. Self-pairs use the exact random-labelling expectation of the allocation count.
- spicy(adjustAbundance = ) now defaults to FALSE (kontextualEngine() is unchanged). The log-share
adjustment does not separate more 'from' cells from more densely packed ones, and it removes real
effects when the share tracks the condition.
- Survival results: the column log_hr_per_cell is renamed log_hr_per_unit, the log hazard ratio per unit
of the effect (per 100% of 'to' cells for the allocation effect, per extra 'from' cell per 'to' cell
for the count).
- The label-clustering factor of the allocation effect is computed on its binary scores.
- Survival results no longer repeat the main test in unadjusted_* columns when abundance is not
adjusted.
- k nearest neighbours: images with at most k cells were read out of bounds in the neighbour sums; they
are now skipped.
spicyR 1.99.4
- The label-clustering factor of a ‘to' type is the median over every counted ('from') type, whichever pairs
are requested, in spicy() and kontextualEngine(). A pair’s result no longer depends on the other pairs asked
for: spicy(from = "A", to = "B") gives exactly the A__B row of spicy(). Before, the factor rested on the
requested pairs only (one ratio per image for a single pair), which in Kontextual simulations cost power.
spicyR 1.99.3
NEW FEATURES
- kontextualEngine(), the engine of Statial::kontextualTest() (documented there): Statial's
Kontextual statistic compared in each image with its exact expectation under random labelling
within the parent, combined by spicy()'s frailty GEE. Internal; topPairs(), signifPlot() and
spicyBoxPlot(parent = ) work on its results.
- signifPlot() draws the survival results of the cell method (it failed before).
- spicy(alternateResult = ) warns when given Kontextual values, which it compares between conditions
as they are, and points to Statial::kontextualTest().
spicyR 1.99.2
- The direction of a pair is reversed relative to 1.99.0 and 1.99.1 (and restored to that of
earlier development versions): from -> to now asks whether 'to' cells are placed near
'from' cells, with the excess counted as extra 'from' cells around each 'to' cell. A result
reported as A -> B by 1.99.0 or 1.99.1 is reported as B -> A now, with the same numbers.
spicyR 1.99.0
MAJOR CHANGES
- spicy() now runs spicyR Cell by default (method = "cell"): for each pair from -> to,
the excess number of 'from' cells within r of each 'to' cell beyond random labelling of
the observed cells (are 'to' cells placed near 'from' cells more than other cells are?), combined over images and patients by a frailty GEE and tested with a
CR2 variance on Satterthwaite degrees of freedom, with patients ('subject') as the units.
The original test is available with method = "image" (and is chosen automatically when
'alternateResult' or 'sigma' is given).
- The direction of a pair: 'to' is the type whose placement is tested (its cells are
relabelled at random under the null, and the excess is per 'to' cell), 'from' the type
counted around it.
NEW FEATURES
- By default the test is adjusted for the abundance of the counted (‘from') type (the log of its share
of all cells in each image; adjustAbundance = TRUE) and for any covariates; the unadjusted
test is reported in the unadjusted_* columns, and each adjustment’s effect and p-value in
abundance_effect and covariate_effect columns.
- spicyBoxPlot() shows a point per image sized by its weight in the test, and is interactive
with interactive = TRUE (plotly); plotImage(r = ) draws the radius around each to cell.
- Two or more conditions (each level against the reference), image- or patient-level
covariates, k nearest neighbours (k), several radii combined by max-T with the sandwich
correlation or by the Cauchy combination (r = c(...), combine), Hartung-Knapp variance for
very few patients, and survival outcomes (a Surv condition: score test and hazard ratio).
- The statistics run in a C++17 core shared verbatim with the Python twin, spicyr
(https://github.com/SydneyBioX/spicyr-py), which reproduces spicyR's results.
- Much faster: every ordered pair of 22 cell types from 400,000 cells (METABRIC) in seconds.
- spicyR 2.0 was written with AI assistance (Claude, Anthropic, through Claude Code), directed by the
authors: the C++ core, its R bindings, R/cell.R and R/spicy_main.R, the C++ ports
of the image method's model fits, the tests (including a plain-R reference written from the
method's equations) and the vignettes. The commits concerned carry a Co-Authored-By line.
- Far fewer dependencies.
spicyR 1.18.0
NEW FEATURES
- Added functionality for survival and mixed effect survival analysis.
- Added new plotting functions for survival analysis.
- Added support for using weights for alternative results.
BUG FIXES
- Fixed issue with bubble plot where unicode characters don't show up on
certain operating systems.
- Fixed issue with bubble plot where legend was not accurately showing
conditions or phenotypes on the plot.
SIGNIFICANT USER-VISIBLE CHANGES
- Vignette has been updated with new dataset showcasing more functionality
of spicyR.
DEPRECATED ARGUMENTS
- 'nCores' argument deprecated for both getPairwise() and spicy(), replaced
with 'cores'.
- 'BPPARAM' argument deprecated for both getPairwise() and spicy(), replaced
with 'cores'.
- 'imageIDCol' argument deprecated for both getPairwise() and spicy(), replaced
with 'imageID'.
- 'cellTypeCol' argument deprecated for both getPairwise() and spicy(), replaced
with 'cellType'.
- 'spatialCoordCols' argument deprecated for both getPairwise() and spicy(), replaced
with 'spatialCoords'.
- 'Rs' argument deprecated for both getPairwise() and spicy(), replaced
with 'r'.
* Deprecation warnings have been added to guide users to the new argument names.