Changelog
Source:NEWS.md
tlsR 0.3.0
Breaking changes
-
scan_clustering()— completely redesigned. The function no longer runs Monte Carlo CSR envelope tests. Instead it computes the K-integral clustering index (mean positive L excess over theoretical CSR) in each sliding window and — whenplot = TRUE(now the default) — draws a spatial base-graphics map with LOESS-smoothed L-excess curves and numeric CI labels overlaid inside each qualifying window. The returned value is a plain list ofLestobjects (one per qualifying window). Thensimargument has been removed; a newmin_phen_cellsargument controls the per-window phenotype-cell threshold.
Improvements to existing functions
calc_icat()— fixed sign-ambiguity bug. The previous implementation returned the raw signed trace of the FastICA mixing matrix, which could be negative. The index is now computed as100 * sqrt(v1 + v2 + 2*sqrt(v1*v2)) / nrow(X)— a normalised trace-standard-deviation of the ICA-reconstructed coordinates — which is always non-negative and reflects average spatial spread per cell in microns.-
plot_TLS()— two visual improvements:- Background (non-TLS, non-TIC) cells are now rendered with
bg_alpha = 0.25by default, making them more visually recessive. - TIC cells are drawn at
point_size * tic_size_mult(default1.8x), making them slightly larger than TLS cells. Both new arguments (bg_alpha,tic_size_mult) are fully exposed.
- Background (non-TLS, non-TIC) cells are now rendered with
Internal
- NAMESPACE updated: added
grDevices::adjustcolor,graphics::*,stats::cov,stats::loess,stats::predict; removedspatstat.explore::envelope(no longer needed). - DESCRIPTION Imports extended to declare
grDevices,graphics,stats. - Vignette updated throughout to reflect all changes.
tlsR 0.2.0
CRAN release: 2026-04-09
New functions
summarize_TLS()— produces a tidydata.framewith one row per sample summarising detected TLS count, size, cell fractions, T-cell clusters, and (optionally) per-TLS ICAT scores.plot_TLS()— ggplot2-based spatial scatter plot of TLS and T-cell cluster membership, using a colourblind-friendly palette. Returns theggplotobject invisibly for further customisation.
Improvements to existing functions
calc_icat()— now returnsNA_real_with an informativemessage()when a TLS has fewer than 3 cells or when FastICA fails to converge, instead of throwing an error.detect_tic()— now returns the updatedldatalist visibly (was invisible). Two new argumentsmin_ptsandmin_cluster_sizeexpose HDBSCAN tuning parameters that were previously hard-coded. Non-T-cell rows now receiveNA(not0) in thetcell_cluster_hdbscancolumn.scan_clustering()— the return value is now a named list of result objects each containingLest,envelope,window_center, andn_cells. Newnsimandmin_cellsarguments added. Tissue-extent guard now fires beforeseq()is called, preventing a wrong-sign error on small datasets.All functions — phenotype matching now accepts both singular (
"B cell","T cell") and plural ("B cells","T cells") labels via internal helpers.is_bcell()and.is_tcell().All functions — the global
ldatafallback now emits awarning()asking users to passldataexplicitly. This behaviour is deprecated and will be removed in v0.3.0.
Bug fixes
plot_TLS()— replaced the Greek mu character (\u03bc) in axis labels with plain ASCII"um"to prevent encoding failures on systems with limited locale support.plot_TLS()— now returns the ggplot object truly invisibly (no implicitprint()call), preventing spurious rendering duringR CMD check.
Package infrastructure
- Minimum R version raised to
>= 4.0.0. -
spatstatimports updated tospatstat.geomandspatstat.explore. -
VignetteBuilder: knitradded to DESCRIPTION (was missing, causing a vignette WARNING inR CMD check). -
LICENSE.mdandcran-comments.mdadded to.Rbuildignore(were generating a NOTE about non-standard top-level files). - Comprehensive
testthatunit tests covering all exported functions. - Vignette
"tlsR-workflow"demonstrating the full analysis pipeline.