Skip to content

Detection and Spatial Analysis of Tertiary Lymphoid Structures

0packages depend
3.1Kdownloads / year
69.1%test coverage
13/13flavors OK

Overview

About

Fast, reproducible detection and quantitative analysis of tertiary lymphoid structures (TLS) in multiplexed tissue imaging. Implements Independent Component Analysis Trace (ICAT) index, local Ripley's K scanning, automated K Nearest Neighbor (KNN)-based TLS detection, and T-cell clusters identification as described in Amiryousefi et al. (2025) doi:10.1101/2025.09.21.677465.

Changes in 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 — when plot = 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 of Lest objects (one per qualifying window). The nsim argument has been removed; a new min_phen_cells argument 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 as 100 * 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.
Show all changes in 0.3.0Hide the rest of the changes in 0.3.0
  • plot_TLS() — two visual improvements:
  • Background (non-TLS, non-TIC) cells are now rendered with bg_alpha = 0.25 by default, making them more visually recessive.
  • TIC cells are drawn at point_size * tic_size_mult (default 1.8x), making them slightly larger than TLS cells.

Both new arguments (bg_alpha, tic_size_mult) are fully exposed.

Internal

  • NAMESPACE updated: added grDevices::adjustcolor, graphics::*, stats::cov, stats::loess, stats::predict; removed spatstat.explore::envelope (no longer needed).
  • DESCRIPTION Imports extended to declare grDevices, graphics, stats.
  • Vignette updated throughout to reflect all changes.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.1 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.3.0
READMEYes · 122 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.3.0Citation fileNo
Help pages
8includes a package overview page
Examples that run
100%7 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
25%

Downloads

3.1K
CRAN downloads in the past year
Rank #10,813 · ~8/day · ~259/mo
Daily download trend is not available in this view yet.
40430 days
97490 days
3.1K1 year
Compare downloads with other packages →
Also on66 r2u3 autocran

Repository

0Stars
0Forks
2Open issues
0Open PRs
0Releases
License file reads as MIT · Last activity 2026-04-23
Responsiveness
not measured
PracticesBeta

2 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/labsyspharm/tlsr on 2026-10-21.

Docs source (1)

GitHub Pages site last deployed 2026-04-23

CRAN release process (1)
cran-comments.md
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)

Installing tlsR adds 34 packages (20 with compiled code, 24 MB of source tarballs). Heaviest: ggplot2 6.0 MB, dbscan 3.8 MB, spatstat.data 2.9 MB.

Depends (1)
R >= 4.0.0
Imports (11)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.1.2 (2025)
Contributor
Releases (3)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.3.0Latest
    record
    2026-04-23 · current release · diff ↗
  • 0.2.0
    record
    2026-04-09 · diff ↗ ·
    added 2 exports
    plot_TLS, summarize_TLS
  • 0.1.2
    record
    2025-12-18
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-12-18
Total releases
3 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.0.0
Bundled data
754 KB / 1 file
Download size
1.0 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("tlsR")
Amiryousefi, A., Sorger, P., & Wala, J. (2026). tlsR: Detection and Spatial Analysis of Tertiary Lymphoid Structures (Version 0.3.0) [Computer software]. https://doi.org/10.32614/CRAN.package.tlsR

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for tlsR version 0.3.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy