Skip to main content

stkan

Variational autoencoder with Kolmogorov-Arnold Network for spatial domain detection.

Experiments were executed on NVIDIA A40 of 46068MiB memory in linux with torch==2.1.0+cu121, torch_geometric==2.3.1, torch-sparse==0.6.18+pt21cu121, and torchvision==0.16.0+cu121.

overview

The stkan is an integrated framework for spatial domain detection in spatial transcriptomics that synergizes the Kolmogorov-Arnold Network (KAN) with a variational autoencoder and contrastive learning. The framework addresses limitations of traditional graph-based methods by leveraging KAN's spline-based activation functions to explicitly model complex nonlinear spatial-gene interactions through univariate function decompositions. The stkan integrates multi-modal inputs including gene expression, spatial coordinates, and optional morphological features extracted via Vision Transformer. The workflow involves preprocessing with PCA dimensionality reduction, encoding through a KAN-based variational autoencoder combined with graph attention networks, and latent representation fusion enhanced by contrastive learning. Spatial domains are identified using Leiden clustering on the refined embeddings, optimized through a composite loss function combining reconstruction, binary cross-entropy, KL-divergence, and contrastive losses. The stkan demonstrates superior performance across multiple datasets including DLPFC, mouse embryo, and cancer tissues, achieving higher accuracy in domain detection and enabling robust downstream analyses like UMAP visualization, PAGA trajectory inference, and functional enrichment studies.

install stkan

pip install torch==2.1.0 torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cu121
pip install torch_sparse==0.6.18+pt21cu121 -f https://data.pyg.org/whl/torch-2.1.0+cu121.html
pip install stkan
# pip install numpy==1.26.4

Metadata

Release files for stkan 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stkan 1.0.0
File Size Uploaded
stkan-1.0.0.tar.gz 22.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stkan 1.0.0
File Interpreter ABI Platform
stkan-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.7 kB

Release files / stkan-1.0.0.tar.gz

Download URL stkan-1.0.0.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c4f0102b93c224e0a1bb7e7b9dcd46c451c1553fd84caf7fda3307d34a646e93
BLAKE2b-256 checksum
How to use checksums
36aa416b733f5ae4b178148491a0957ecbf688de3b7ad94842ac712da23626ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.4

Release files / stkan-1.0.0-py3-none-any.whl

Download URL stkan-1.0.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
046bd08bb34c9f6cda412ce206b9f14474134368044477096cee3c3897b17802
BLAKE2b-256 checksum
How to use checksums
23c3a2331e07e63d9511360d51ce5e58e70bed6fcf3447894cdbdaf2e3dec4c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page