{"id":31805772,"url":"https://github.com/theislab/ssl_in_scg","last_synced_at":"2025-10-11T02:58:22.452Z","repository":{"id":231164925,"uuid":"748637452","full_name":"theislab/ssl_in_scg","owner":"theislab","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-22T08:59:50.000Z","size":7268,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T09:28:44.366Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theislab.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-01-26T12:38:27.000Z","updated_at":"2025-02-28T00:18:12.000Z","dependencies_parsed_at":"2024-04-09T14:01:12.926Z","dependency_job_id":"84b4f845-6612-406e-9e2c-1a539500e1dd","html_url":"https://github.com/theislab/ssl_in_scg","commit_stats":null,"previous_names":["theislab/ssl_in_scg"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/theislab/ssl_in_scg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fssl_in_scg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fssl_in_scg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fssl_in_scg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fssl_in_scg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theislab","download_url":"https://codeload.github.com/theislab/ssl_in_scg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fssl_in_scg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005949,"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:58:17.292Z","updated_at":"2025-10-11T02:58:22.447Z","avatar_url":"https://github.com/theislab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"Delineating the Effective Use of Self-Supervised Learning in Single-Cell Genomics\n=================================================================================\n\nRepository for the `paper \u003chttps://doi.org/10.1101/2024.02.16.580624\u003e`_.\n\nSystem Requirements\n-------------------\n- Python 3.10\n- Dependencies listed in `requirements.txt`\n\nInstallation Guide\n-------------------\n1. Create a conda environment:\n\n   .. code-block:: bash\n\n       conda env create -f environment.yml\n\n2. Activate the environment:\n\n   .. code-block:: bash\n\n       conda activate ssl\n\n3. Install the package in development mode:\n\n   .. code-block:: bash\n\n       cd directory_where_you_have_your_git_repos/ssl_in_scg\n       pip install -e .\n\n4. Create symlink to the storage folder for experiments:\n\n   .. code-block:: bash\n\n       cd directory_where_you_have_your_git_repos/ssl_in_scg\n       ln -s folder_for_experiment_storage project_folder\n\nDemo\n----\n\n**Large Dataset:**\n\nFor large datasets, use the store-creation notebooks in the `scTab repository \u003chttps://github.com/theislab/scTab/tree/main/notebooks/store_creation\u003e`_ to create a Merlin datamodule for efficient data loading.\n\n**Small Dataset or Single Adata Object:**\n\nFor small datasets or a single Adata object, a simple PyTorch dataloader suffices. Refer to our `multiomics application \u003chttps://github.com/theislab/ssl_in_scg/blob/master/self_supervision/data/datamodules.py#L173\u003e`_. A minimal example for masked pre-training of a smaller adata object is available in `sc_mae \u003chttps://github.com/theislab/sc_mae\u003e`_.\n\n**Expected output:**\n\nRunning the models will generate a checkpoint file with trained model parameters, saved using PyTorch Lightning's checkpointing functionality. This file can be used for inference, further training, or reproducibility.\n\n**Expected run time:**\n\nWe pre-trained on a single GPU for approximately 1-2 days and fine-tuned on a single GPU about 12-24 hours. This depends, among others, on the underlying architecture, dataset, and hyperparameters. So, convergence should be watched.\n\nModel checkpoints\n-----------------\nPre-trained model checkpoints are available on `Hugging Face \u003chttps://huggingface.co/TillR/sc_pretrained\u003e`_.\n\nRetraining\n----------\n\nObtain the dataset from the `scTab repository \u003cgithub.com/theislab/scTab\u003e`_ or write a Merlin store on your custom data. Then change `DATA_DIR` in `paths.py` to your custom dataset or keep it with the scTab dataset. After that, follow the scripts for pre-training and fine-tuning.\n\nCitation\n--------\n\nIf you find our work useful, please cite the following paper:\n\n**Delineating the Effective Use of Self-Supervised Learning in Single-Cell Genomics**\n\n`Link to the paper \u003chttps://doi.org/10.1101/2024.02.16.580624\u003e`_\n\nIf you use the scTab data in your research, please cite the following paper:\n\n**Scaling cross-tissue single-cell annotation models**\n\n`Link to the paper \u003chttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC10592700/\u003e`_\n\nLicence\n-------\n`self_supervision` is licensed under the `MIT License \u003chttps://opensource.org/licenses/MIT\u003e`_.\n\nAuthors\n-------\n\n`ssl_in_scg` was written by `Till Richter \u003ctill.richter@helmholtz-muenchen.de\u003e`_, `Mojtaba Bahrami \u003cmojtaba.bahrami@helmholtz-muenchen.de\u003e`_, `Yufan Xia \u003cyufan.xia@helmholtz-muenchen.de\u003e`_ and `Felix Fischer  \u003cfelix.fischer@helmholtz-muenchen.de\u003e`_ .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheislab%2Fssl_in_scg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheislab%2Fssl_in_scg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheislab%2Fssl_in_scg/lists"}