seq-lumen#
A small package for lumen/luminal-structure quantification only from centroids. Based on [RDPC+26]’s method for quantification, with some small (presumed) fixes.
Getting started#
Please refer to the documentation, in particular, the API documentation.
import seq_lumen
from anndata.acc import A
# Set up relevant accessors for each relevant field.
border_acc = A.obs["is_epithelial"]
# Only if needed with multiple samples
sample_acc = A.obs["sample_id"]
# Only if needed - the default check for centroids looks in obsm["spatial"]
# centroids_acc = A.obsm["X_spatial"]
assert seq_lumen.acc.centroids_acc in adata
# Resolve the parameters for quantification for all applicable samples, if present.
# This is much more robust than the defaults, which match Reyes et al.
sl_quantifier = seq_lumen.Quantifier.from_adata(adata, sample_acc=sample_acc)
# Each value of `lumen` is a `(n_lumen_points, 2)` array of luminal centroids and the key is the sample id.
# If no `sample_acc` is passed in, just a single ndarray is returned, calculated over all centroids/borders together.
lumen: dict[str, np.ndarray] = sl_quantifier(adata, border_acc=border_acc, sample_acc=sample_acc)
# Per-cell lumen scores and lumen ids are written to these default accessors (pass `count_acc`/`assignment_acc` to override in the above quantifier call)
assert seq_lumen.acc.count_acc in adata
assert seq_lumen.acc.assignment_acc in adata
Divergences from the Original#
There are a combination of fixes/divergences from the original code/paper, some bugs, some things being misreported.
These are indicated within the code and in the docstring of seq_lumen.Quantifier.
If you wish to reproduce the [RDPC+26] paper’s results exactly, go to the paper’s repo.
Installation#
You need to have Python 3.12 or newer installed on your system. If you don’t have Python installed, we recommend installing uv.
We recommend managing dependencies in project-specific virtual environments to avoid dependency conflicts. This is most convenient using package managers such as uv. Choose from the options below to install seq-lumen:
Install the latest development version:
pip install seq-lumen # (or `uv add`)
Release notes#
See the changelog.
Contact#
For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.
Citation#
Reyes, J., Del Priore, I., Chaikovsky, A. C., Pasnuri, N., Elhossiny, A. M., Park, J., Weiler, P., Krause, T., Moorman, A., Snopkowski, C., Takizawa, M., Burdziak, C., Ratnayeke, N., Masilionis, I., Ho, Y.-J., Chaligné, R., Romesser, P. B., Filliol, A., Nawy, T., … Lowe, S. W. (2026). Oncogenic and tumor-suppressive forces converge on a progenitor niche at the benign-to-malignant transition. Cell, 189(10), 2875–2897.e53. https://doi.org/10.1016/j.cell.2026.03.032