NEWS
lisaClust 1.21.13
- lisaClust() put regions on the right cells only when cell IDs were unique across images; with cell IDs
that repeat in each image (1, 2, ... per image), most cells were left without a region. Regions now go
back to the cells by position, and results with unique cell IDs are unchanged.
- lisa() returns its rows in the order of 'cells' rather than grouped by image, so its curves can be
clustered and put back on a SingleCellExperiment or SpatialExperiment directly. Input that is already
ordered by image gives the same matrix as before. Without a cellID column, the rows are named cell_1,
cell_2, ... in the order of 'cells'.
- lisa() and lisaClust() stop with a message naming the column when image IDs, cell types or coordinates
are missing (a missing cell type crashed R; a missing image ID dropped the cell). Image IDs that are
factors with unused levels work. lisaClust() checks the length of 'cellWeights'.
- hatchingPlot() treats a numeric region column as categories instead of failing with "Continuous value
supplied to a discrete scale".
- Deprecated arguments of lisa() are reported as lisa()'s rather than lisaClust()'s.
lisaClust 1.21.12
- Matrix is listed in Suggests (it is used only when 'cellWeights' is a sparse Matrix), and inhomLocalK()
documents its internal 'membership' argument, clearing the two R CMD check warnings.
lisaClust 1.21.11
- regionBoxPlot() takes ‘subject': the shares are then those of each patient’s cells, all images pooled, one
point per patient.
- regionMap() turns the region labels upright when there are more than six regions, so they do not overlap.
- The vignette is simpler: the example tumours are named rather than computed, the group medians come from
spicyR's colTest() (which now reports them), patients are given as 'subject', and the region labels need no
theme() adjustment. Needs spicyR 1.99.38.
lisaClust 1.21.10
- Tests pass with a single-threaded BLAS (R's reference BLAS, as on the Bioconductor build machines).
lisaClust 1.21.9
- Cell weights: lisa() and lisaClust() take cellWeights, either a vector with one weight in [0, 1] per cell for
its own cell type (for example a quality score) or a cells x labels matrix (base or sparse) of soft cell type
membership, for example a classifier's confidence. The curves are then
one per label: each neighbour counts towards a label in proportion to its weight, and a label's density is its
summed weight per unit area. Labels may overlap (a group and its subtypes). A matrix of 0s and 1s with one 1
per row gives the curves of the cell types exactly. The weighted curves are computed in the shared core
(localCurvesWeighted()), as in lisaclust.
lisaClust 1.21.8
- lisa() and lisaClust() with cores > 1 start their workers once per call and send them only the number
of each image, in about eight chunks per worker, instead of forking a new process for every chunk.
BLAS and OpenMP run one thread in each worker during the call (RhpcBLASctl, now imported), so OpenBLAS
no longer starts one thread per core in every worker. Results are unchanged.
lisaClust 1.21.7
- Concave windows are computed by a C++ port of concaveman in the core, which gives the same polygon as
concaveman::concaveman(); concaveman is no longer needed. hatchingPlot(), whose default window is
"concave", works without it again.
lisaClust 1.21.6
- concaveman moves to Suggests: it is needed only for window = "concave".
lisaClust 1.21.5
- nameRegions() names each region by the marker cell type it is most enriched for; regions most enriched
for the same marker get the same name.
- regionBoxPlot() draws the share of each region in each image, or each patient, by group.
- regionMap(type = "table") returns the relative frequency of each cell type in each region as a matrix.
- The vignette uses spicyR's colTest() to compare regions between groups and tidySpatialExperiment to
summarise the cells of each image.
lisaClust 1.21.4
- hatchingPlot(), geom_hatching() and scale_region_manual() have 12 hatchings instead of 7: none, /, \, -,
|, x, +, dots, circles, / with dots, \ with dots and - with dots (in that order). Regions beyond the
twelfth are drawn as the first. Legend keys are drawn from the same definitions as the hatching.
lisaClust 1.21.3
- hatchingPlot() and geom_hatching() outline each region by the union of the Voronoi tiles of its cells,
clipped to the window, instead of a grid of nbp x nbp points: the outlines follow the cells exactly and
'nbp' is no longer used. The hatching lines are clipped to each outline by polyclip, so they cannot cross
into another region. Drawing an image of about 6,000 cells takes about 3 s, and printing it again 0.8 s.
- The concave window is built without a loop over cells (about 3 times faster, same window).
lisaClust 1.21.2
- A cell now counts itself among the cells of its type (at distance 0), as the local indicators are defined in
Patrick et al. (2023). Before, it was left out of its own count. This changes the LISA of every cell for its
own type, and so the regions; cells with no neighbour within the largest radius now have LISA values
rather than zeros.
- hatchingPlot() and geom_hatching(): a hatching line that passed exactly through or touched a corner of a
region's outline could be counted as crossing it an odd number of times, which put later segments of the
line out of step and drew them across neighbouring regions (with the warning "data length is not a
multiple of split variable"). Crossings now follow a half-open rule, so each outline is crossed an even
number of times.
- geom_hatching() keeps the hatching of the most recently drawn panels, so printing a plot again (for
example when resizing its window) does not recompute it.
lisaClust 1.21.1
- The neighbour counts and edge corrections of lisa(), lisaClust() and inhomLocalK() are computed in C++
(src/core, shared with the Python package lisaclust): about 8 to 18 times faster. The edge correction
intersects each disc with the window exactly instead of through spatstat's integer-rounded polygon
clipping, which changes the LISA by less than 1e-6; regions are otherwise unchanged.
- hatchingPlot() and geom_hatching() are about 10 times faster: the hatching lines are intersected with the
region outlines all at once, and the region of each grid point is that of the nearest cell, found in
C++. Equidistant cells vote and a tied vote goes to the first region, so the plot no longer depends on the
random seed.
- Bug fix: lisaClust() assigned the regions to the wrong cells when the cells of different images were
interleaved rather than ordered by image. Regions are now matched to cells by their position in the input.
hatchingPlot() had the same problem with the region column, and now also accepts a data.frame.
- Bug fix: regionMap() failed when a cell type had no cells (an unused factor level).
- Bug fix: lisaClust() failed on a SpatialExperiment whose coordinates are only in spatialCoords().
- lisaClust no longer depends on spicyR, simpleSeg, class, data.table or tidyr. The examples use simulated
data, and the vignette finds tissue domains in triple-negative breast cancer and cellular niches in
colorectal cancer, compared between groups of patients.