DenoIST is a package for denoising image-based spatial transcriptomics data. It takes a IST count matrix and returns a adjusted count matrix with contamination removed.
The package is designed to be used with the SpatialExperiment class. If you are using a different format, a matrix input with a data frame of coordinates can also be accepted.
This is still very much a work in progress and we are still working on the documentation. Please feel free to open an issue or email at akwok@svi.edu.au if you have any questions or suggestions.
2026-03-17: Major update
local_offset_distance_with_background_fast function which uses dbscan for faster neighbour finding. Also fixed critical bug that causes wrong distance calculation.denoist() now defaults to fast neighbour finding via the neighbour_mode option.2026-02-24: Minor update
n_inits can now be tuned in the denoist() function for speed.2025-06-25: Major update
parallel.2025-05-20: Initial release of DenoIST. The package is now available on and GitHub.
From Bioconductor:
if(!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("DenoIST")
Or from Github directly:
BiocManager::install(c('sparseMatrixStats', 'SpatialExperiment','SummarizedExperiment'))
devtools::install_github("aaronkwc/DenoIST")
In most cases, you will only need to use the denoist() wrapper function.
It takes 2-3 inputs:
mat : SpatialExperiment object (with the counts in assay() slot) or a count matrix with genes as rows and cells as columns.tx: Transcript data frame (a data frame with each row being an individual transcript, with columns specifying each transcripts' coordinates and qv). If your transcript file is not from Xenium and has no qv score, you can set a dummy column of qv = 20 for all transcripts. This workaround should not be needed in future updates.coords: If using a count matrix, a data frame (cells x 2) for each cell's centroid 2D coordinate.The function will return a list with
adjusted_counts: The adjusted counts matrix with contamination removed.memberships: A data frame with the inferred identity of each gene in each cell (1 for real or 0 for contamination).params: A list with the estimated parameters used in the model. The posterior probabilities of each gene being real or contamination can be found in params$posterior_probs, higher means more likely to be contamination.You can run ?denoist for more details on the extra parameters you can adjust.
With a SpatialExperiment object:
library(DenoIST)
library(SpatialExperiment)
res <- denoist(mat = spe,
tx = tx,
coords = NULL,
distance = 50, nbins = 200, cl = 1,
out_dir = "denoist_results")
With a count matrix and coordinates:
library(DenoIST)
res <- denoist(mat = mat,
tx = tx,
coords = coords,
distance = 50, nbins = 200, cl = 1,
out_dir = "denoist_results")
Check out the vignette to get started:
library(DenoIST)
browseVignettes("DenoIST")