{"id":31805736,"url":"https://github.com/theislab/scproto","last_synced_at":"2025-10-11T02:57:52.559Z","repository":{"id":289053317,"uuid":"967360503","full_name":"theislab/scproto","owner":"theislab","description":"Interpretable self-supervised prototype learning for denoising and integrating single-cell transcriptomic data via biologically meaningful metacells.","archived":false,"fork":false,"pushed_at":"2025-09-22T05:16:31.000Z","size":127106,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T07:12:55.957Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theislab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-16T10:37:40.000Z","updated_at":"2025-09-03T08:16:16.000Z","dependencies_parsed_at":"2025-09-22T07:20:13.353Z","dependency_job_id":null,"html_url":"https://github.com/theislab/scproto","commit_stats":null,"previous_names":["theislab/scproto"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theislab/scproto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fscproto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fscproto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fscproto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fscproto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theislab","download_url":"https://codeload.github.com/theislab/scproto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fscproto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005950,"owners_count":26084009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-11T02:57:49.505Z","updated_at":"2025-10-11T02:57:52.554Z","avatar_url":"https://github.com/theislab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interpretable Self-Supervised Prototype Learning for Single-Cell Transcriptomics\n\n**Learn cross-batch metacells** using interpretable self-supervised prototype learning to **denoise** and **preserve biological structure** in single-cell data — without using labels.\n\n📄 [Read the paper (ICLR 2025 - LMRL Workshop)](https://openreview.net/forum?id=mTjWUeyll5\u0026noteId=mTjWUeyll5)\n\n\n## Overview\n\nSingle-cell RNA-seq data is often **noisy**, **sparse**, and affected by **batch effects**, which can obscure meaningful biological insights.  \n**scProto** is an interpretable self-supervised prototype learning method that learns biologically meaningful **prototypes** and decodes them into **metacells** — compact, denoised representations of cell populations across batches.\n\n- Learns **cross-batch metacells** that reflect biologically meaningful cell groups  \n- Trained to **preserve biological structure** and **cell-cell relationships** in the embedding space while mitigating batch effects  \n- Fully **label-free**, requiring no annotations  \n\n## Key Features\n\n- **Interpretable prototype learning** and **metacell decoding** across datasets  \n- Embedding space that maintains **biological topology** and **local cell relationships**  \n- Enhances single-cell analysis by **denoising gene expression** and **overcoming data sparsity**\n\n## Model Architecture\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"scproto.png\" alt=\"scProto Model Architecture\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n**scProto** builds upon the **CVAE architecture from scPoli**, designed for interpretable reconstruction of gene expression, and combines it with a **self-supervised prototype learning strategy based on SwAV** (Swapped Assignment between Views).\n\nThe model is trained end-to-end to learn:\n\n1. **Prototypes** via SwAV-style self-supervised contrastive learning  \n2. **Metacell reconstructions** by **decoding prototypes using the CVAE decoder**  \n3. **Coverage of rare cell types** via a Propagation loss\n\nThis unified design allows the model to **aggregate similar cells**, **preserve cell-cell structure**, and **denoise gene expression**, all while being **fully unsupervised**.\n\n## Method\n\nWe use **SwAV**, a self-supervised contrastive clustering method, to learn prototypes that represent transcriptionally similar groups of cells. \n\n### Key Components:\n\n- **SwAV Loss (per-batch averaged)**  \n  Prevents batch-specific prototype collapse by computing prototype assignments **within each batch** and averaging the loss across batches\n\n- **CVAE Decoder (from scPoli)**  \n  Ensures that each prototype can be **decoded into a metacell**, preserving biologically relevant expression profiles while supporting interpretability\n\n- **Propagation Loss**  \n  A min-max objective to ensure that **rare cell types** are assigned to at least one prototype\n\nTogether, these components optimize the composite loss:\n\n$$\nL_{\\text{scProto}} = L_{\\text{batchSwAV}} + \\lambda_1 \\cdot L_{\\text{propagation}} + \\lambda_2 \\cdot L_{\\text{CVAE}}\n$$\n\n\nThis enables **scProto** to:\n\n- Learn **interpretable cross-batch prototypes**  \n- **Preserve biological structure** in the embedding space  \n- **Denoise** sparse gene expression  \n- **Improve rare cell type representation**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheislab%2Fscproto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheislab%2Fscproto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheislab%2Fscproto/lists"}