--- title: Flexynesis Tissue VAE emoji: 🧬 colorFrom: blue colorTo: purple sdk: streamlit sdk_version: 1.58.0 app_file: app.py pinned: false license: mit --- # Flexynesis Tissue VAE Upload a bulk RNA-seq gene expression matrix to get UBERON tissue-of-origin predictions and 121-dimensional latent embeddings. ## Model Supervised variational autoencoder trained on **118,263 tissue-curated samples** from TCGA, GTEx, and ARCHS4 across **42 UBERON tissue categories** (cell lines excluded, classes balanced). - **Balanced accuracy:** 94.9% - **Weighted F1:** 96.2% - **Latent space:** 121 dimensions - **Genes:** 16,115 HGNC symbols ## How this demo runs This Space runs the **trained model directly** via a 53 MB int8 TorchScript build (`vae_tissue_int8.torchscript.pt`) — exact VAE inference, no approximation. Uploaded samples are aligned to the 16,115 model genes, scaled, and encoded by the supervised VAE; tissue is predicted from the classifier head with softmax confidence. The full-precision model (`vae_tissue.final_model.pth`) and training data are deposited on Zenodo (https://doi.org/10.5281/zenodo.20595537); see the GitHub tutorial to reproduce. ## Input format A CSV or TSV with **genes in rows and samples in columns** (the app auto-detects orientation and transposes if needed): - First column: **HGNC gene symbols** - Header row: sample IDs - Values: **log2-transformed** expression (TPM, RPKM, or counts) Example (first rows of the included `test_10samples.csv`): ``` ,GSM3823940,ACH-000142,TCGA-CZ-4865-11,GTEX-1HFI6-0126 A1BG,8.73,2.74,4.81,2.35 A1CF,7.83,0.05,1.33,0.02 ``` ## Try it A ready-to-use example, **`test_10samples.csv`** (10 samples), is included in this Space. Download it from the Files tab and upload it to see the demo run end to end. ## Output For each sample, the app returns: - Predicted **UBERON tissue** category - **Confidence** (softmax probability from the VAE classifier) - A downloadable **121-dimensional embedding** (CSV) and the full classification table (CSV) ## Citation Pande A, Uyar B, Akalin A. An atlas-scale generative model for unified representation learning of bulk RNA-seq data. *bioRxiv* (2026). ## About Akalin Lab, Max Delbrück Center for Molecular Medicine (MDC) Berlin/BIMSB GitHub: https://github.com/BIMSBbioinfo/flexynesis_tissue_vae_manuscript