Detection and Spatial Analysis of Tertiary Lymphoid Structures

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) .


tlsR

CRAN status R-CMD-check

tlsR provides fast, reproducible detection and spatial analysis of Tertiary Lymphoid Structures (TLS) in multiplexed tissue imaging data (mIHC, CODEX, IMC, etc.).

Installation

# Stable release from CRAN
install.packages("tlsR")

# Development version from GitHub
# install.packages("remotes")
remotes::install_github("labsyspharm/tlsR")

Quick start

library(tlsR)

data(toy_ldata)

# 1. Detect TLS
ldata <- detect_TLS("ToySample", k = 30, ldata = toy_ldata)

# 2. Score each TLS with ICAT
calc_icat("ToySample", tlsID = 1, ldata = ldata)

# 3. Detect T-cell clusters outside TLS
ldata <- detect_tic("ToySample", ldata = ldata)

# 4. Tidy summary table
summarize_TLS(ldata)

# 5. Spatial plot
plot_TLS("ToySample", ldata = ldata)

Data format

ldata is a named list of data frames, one per sample, each with columns:

Column Type Description
x numeric X coordinate (microns)
y numeric Y coordinate (microns)
phenotype character "B cell", "T cell", or other

Citation

Amiryousefi et al. (2025). Detection and spatial analysis of tertiary lymphoid structures in multiplexed tissue imaging. https://doi.org/10.1101/2025.09.21.677465

License

MIT © Ali Amiryousefi

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("tlsR")

0.3.0 by Ali Amiryousefi, 6 months ago


https://github.com/labsyspharm/tlsR


Browse source code at https://github.com/cran/tlsR


Authors: Ali Amiryousefi [aut, cre] (ORCID: , Jeremiah Wala [aut] , Peter Sorger [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dbscan, fastICA, FNN, spatstat.explore, spatstat.geom, ggplot2, rlang, grDevices, graphics, stats, methods

Suggests knitr, rmarkdown, testthat


See at CRAN