{"id":38025780,"url":"https://github.com/biomed-ai/sango","last_synced_at":"2026-01-16T19:33:58.488Z","repository":{"id":197519498,"uuid":"696078531","full_name":"biomed-AI/SANGO","owner":"biomed-AI","description":"The official implementation for \"SANGO\".","archived":false,"fork":false,"pushed_at":"2024-02-03T02:37:31.000Z","size":19038,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-06T00:02:48.486Z","etag":null,"topics":["bioinformatics","cell-type-annotation","cell-type-classification","cell-type-identification","sequence","single-cell","supervised-classification-methods"],"latest_commit_sha":null,"homepage":"","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/biomed-AI.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}},"created_at":"2023-09-25T03:17:17.000Z","updated_at":"2024-04-17T12:50:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"e322084f-22fb-488e-a782-1215d90ce68d","html_url":"https://github.com/biomed-AI/SANGO","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":"0.47058823529411764","last_synced_commit":"ec6b309525f28a57ce4813ecb43e68fd5ab24467"},"previous_names":["biomed-ai/sango"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/biomed-AI/SANGO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomed-AI%2FSANGO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomed-AI%2FSANGO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomed-AI%2FSANGO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomed-AI%2FSANGO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biomed-AI","download_url":"https://codeload.github.com/biomed-AI/SANGO/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biomed-AI%2FSANGO/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bioinformatics","cell-type-annotation","cell-type-classification","cell-type-identification","sequence","single-cell","supervised-classification-methods"],"created_at":"2026-01-16T19:33:57.737Z","updated_at":"2026-01-16T19:33:58.474Z","avatar_url":"https://github.com/biomed-AI.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](figures/model.png)\r\n\r\n\u003cfont size=4\u003e We propose a novel method, SANGO, for accurate single cell annotation by integrating genome sequences around the accessibility peaks within scATAC data.  \u003c/font\u003e \u003cbr\u003e\u003cbr\u003e\r\n\r\n\r\n# SANGO\r\n\r\nThe official implementation for \"**SANGO**\".\r\n\r\n**Table of Contents**\r\n\r\n* [Datasets](#Datasets)\r\n* [Installation](#Installation)\r\n* [Usage](#Usage)\r\n* [Tutorial](#Tutorial)\r\n* [Citation](#Citation)\r\n\r\n## Datasets\r\n\r\n\r\nWe provide an easy access to the used datasets in the [synapse](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n\r\n\r\n## Installation\r\n\r\nTo reproduce **SANGO**, we suggest first create a conda environment by:\r\n\r\n~~~shell\r\nconda create -n SANGO python=3.8\r\nconda activate SANGO\r\n~~~\r\n\r\nand then run the following code to install the required package:\r\n\r\n~~~shell\r\npip install -r requirements.txt\r\n~~~\r\n\r\nand then install [PyG](https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html) according to the CUDA version, take torch-1.13.1+cu117 (Ubuntu 20.04.4 LTS) as an example:\r\n\r\n~~~shell\r\npip install torch_geometric\r\npip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.1+cu117.html\r\n~~~\r\n\r\n## Usage\r\n\r\n### data preprocessing\r\n\r\n\r\nIn order to run **SANGO**, we need to first create anndata from the raw data.\r\n\r\nThe h5ad file should have cells as obs and peaks as var. There should be at least three columns in `var`:  `chr`, `start`, `end` that indicate the genomic region of each peak. The h5ad file should also contain two columns in the `obs`: `Batch` and `CellType` （reference data）, where `Batch` is used to distinguish between reference and query data, and `CellType` indicates the true label of the cell.\r\n\r\nNotice that we filter out peaks accessible in \u003c 1% cells for optimal performance.\r\n\r\n### Stage 1: embeddings extraction\r\n\r\nThe processed data are used as input to CACNN and a reference genome is provided to extract the embedding incorporating sequence information: \r\n\r\n~~~shell\r\n# Stage 1: embeddings extraction\r\ncd SANGO/CACNN\r\n\r\npython main.py -i ../../preprocessed_data/reference_query_example.h5ad \\ # input data(after data preprocessing)\r\n               -g mm9 \\ # reference genome\r\n               -o ../../output/reference_query_example # output path\r\n~~~\r\n\r\nRunning the above command will generate three output files in the output path:\r\n\r\n* `CACNN_train.log`: recording logs during training\r\n* `CACNN_best_model.pt`: storing the model weights with the best AUC score during training\r\n* `CACNN_output.h5ad`: an anndata file storing the embedding extracted by CACNN.\r\n\r\n### Stage 2: cell type prediction\r\n\r\n~~~shell\r\n# Stage 2: cell type prediction\r\ncd ../GraphTransformer\r\n\r\npython main.py  --data_dir ../../output/reference_query_example/CACNN_output.h5ad \\ # input data\r\n                --train_name_list reference --test_name query \\\r\n                --save_path ../../output \\\r\n                --save_name reference_query_example\r\n~~~\r\n\r\nRunning the above command will generate three output files in the output path:\r\n\r\n* `model.pkl`: storing the model weights with the best valid loss during training.\r\n* `embedding.h5ad`: an anndata file storing the embedding extracted by GraphTransformer.  And `.obs['Pred']` saves the results of the prediction.\r\n\r\n\r\n\r\n\r\n## Tutorial\r\n\r\n### Tutorial 1: Cell annotations within samples (LargeIntestineB_LargeIntestineA)\r\n1. Install the required environment according to [Installation](#Installation).\r\n2. Create a `data` folder in the same directory as the 'SANGO' folder and download datasets from [LargeIntestineA_LargeIntestineB.h5ad](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n3. Create a folder `genome` in the ./SANGO/CACNN/ directory and download [mm9.fa.h5](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n4. For more detailed information, run the tutorial [LargeIntestineB_LargeIntestineA.ipynb](LargeIntestineB_LargeIntestineA.ipynb) for how to do data preprocessing and training.\r\n\r\n\r\n\r\n\r\n### Tutorial 2: Cell annotations on datasets cross platforms (MosP1_Cerebellum)\r\n1. Install the required environment according to [Installation](#Installation).\r\n2. Create a `data` folder in the same directory as the 'SANGO' folder and download datasets from [MosP1_Cerebellum.h5ad](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n3. Create a folder `genome` in the ./SANGO/CACNN/ directory and download [mm10.fa.h5](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n4. For more detailed information, run the tutorial [MosP1_Cerebellum.ipynb](MosP1_Cerebellum.ipynb) for how to do data preprocessing and training.\r\n\r\n\r\n\r\n\r\n### Tutorial 3: Cell annotations on datasets cross tissues (BoneMarrowB_Liver)\r\n1. Install the required environment according to [Installation](#Installation).\r\n2. Create a `data` folder in the same directory as the 'SANGO' folder and download datasets from [BoneMarrowB_Liver.h5ad](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n3. Create a folder `genome` in the ./SANGO/CACNN/ directory and download [mm9.fa.h5](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n4. For more detailed information, run the tutorial [BoneMarrowB_Liver.ipynb](BoneMarrowB_Liver.ipynb) for how to do data preprocessing and training.\r\n\r\n\r\n### Tutorial 4: Multi-level cell type annotation and unknown cell type identification\r\n1. Install the required environment according to [Installation](#Installation).\r\n2. Create a `data` folder in the same directory as the 'SANGO' folder and download datasets from [BCC_TIL_atlas.h5ad, BCC_samples.zip, HHLA_atlas.h5ad](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n3. Create a `genome` folder in the same directory as the 'SANGO' folder and download [GRCh38.primary_assembly.genome.fa.h5](https://www.synapse.org/#!Synapse:syn52559388/files/).\r\n4. For more detailed information, run the tutorial [tumor_example.ipynb](tumor_example.ipynb) for how to do data preprocessing and training.\r\n\r\n\r\n## Citation\r\n\r\nIf you find our codes useful, please consider citing our work:\r\n\r\n~~~bibtex\r\n\r\n\r\n@article{zengSANGO,\r\n  title={Deciphering Cell Types by Integrating scATAC-seq Data with Genome Sequences},\r\n  author={Yuansong Zeng, Mai Luo, Ningyuan Shangguan, Peiyu Shi, Junxi Feng, Jin Xu, Weijiang Yu, and Yuedong Yang},\r\n  journal={},\r\n  year={2023},\r\n}\r\n~~~","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiomed-ai%2Fsango","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiomed-ai%2Fsango","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiomed-ai%2Fsango/lists"}