├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.md ├── README_CH.md ├── came ├── PARAMETERS.py ├── __init__.py ├── datapair │ ├── __init__.py │ ├── aligned.py │ └── unaligned.py ├── model │ ├── __init__.py │ ├── _minibatch.py │ ├── _predict.py │ ├── _utils.py │ ├── base_layers.py │ ├── cgc.py │ ├── cggc.py │ ├── heteroframe.py │ ├── hidden.py │ ├── loss.py │ └── v0 │ │ ├── __init__.py │ │ ├── _minibatch.py │ │ ├── _predict.py │ │ ├── _utils.py │ │ ├── base_layers.py │ │ ├── cgc.py │ │ ├── cggc.py │ │ ├── heteroframe.py │ │ ├── hidden.py │ │ └── loss.py ├── pipeline.py ├── sample_data.zip └── utils │ ├── __init__.py │ ├── _alluvial.py │ ├── _base_trainer.py │ ├── _get_example_data.py │ ├── _io_h5py.py │ ├── analyze.py │ ├── base.py │ ├── downsample_counts.py │ ├── evaluation.py │ ├── plot.py │ ├── preprocess.py │ ├── train.py │ └── train_v0.py ├── docs ├── .nojekyll ├── Makefile ├── _config.yml ├── _images │ ├── Fig1ABC.png │ ├── Fig1D.png │ ├── tut_notebooks_getting_started_pipeline_aligned_16_1.png │ ├── tut_notebooks_getting_started_pipeline_aligned_18_1.png │ ├── tut_notebooks_getting_started_pipeline_aligned_22_1.png │ ├── tut_notebooks_getting_started_pipeline_aligned_22_3.png │ ├── tut_notebooks_getting_started_pipeline_un_17_1.png │ ├── tut_notebooks_getting_started_pipeline_un_19_1.png │ ├── tut_notebooks_getting_started_pipeline_un_23_1.png │ ├── tut_notebooks_getting_started_pipeline_un_23_3.png │ ├── tut_notebooks_getting_started_pipeline_un_29_1.png │ ├── tut_notebooks_getting_started_pipeline_un_30_0.png │ ├── tut_notebooks_getting_started_pipeline_un_32_1.png │ ├── tut_notebooks_getting_started_pipeline_un_32_3.png │ ├── tut_notebooks_getting_started_pipeline_un_39_0.png │ ├── tut_notebooks_getting_started_pipeline_un_40_0.png │ └── tut_notebooks_getting_started_pipeline_un_43_1.png ├── _sources │ ├── api.rst.txt │ ├── citation.rst.txt │ ├── faqs.rst.txt │ ├── generated │ │ ├── came.AlignedDataPair.rst.txt │ │ ├── came.CGCNet.rst.txt │ │ ├── came.CGGCNet.rst.txt │ │ ├── came.DataPair.rst.txt │ │ ├── came.aligned_datapair_from_adatas.rst.txt │ │ ├── came.datapair_from_adatas.rst.txt │ │ ├── came.load_dpair_and_model.rst.txt │ │ ├── came.load_example_data.rst.txt │ │ ├── came.load_hidden_states.rst.txt │ │ ├── came.load_pickle.rst.txt │ │ ├── came.make_features.rst.txt │ │ ├── came.pipeline.gather_came_results.rst.txt │ │ ├── came.pipeline.main_for_aligned.rst.txt │ │ ├── came.pipeline.main_for_unaligned.rst.txt │ │ ├── came.pipeline.preprocess_aligned.rst.txt │ │ ├── came.pipeline.preprocess_unaligned.rst.txt │ │ ├── came.save_hidden_states.rst.txt │ │ ├── came.save_pickle.rst.txt │ │ ├── came.utils.analyze.compare_modules.rst.txt │ │ ├── came.utils.analyze.compute_common_private.rst.txt │ │ ├── came.utils.analyze.make_abstracted_graph.rst.txt │ │ ├── came.utils.analyze.weight_linked_vars.rst.txt │ │ ├── came.utils.analyze.weight_linked_vars_by_expr.rst.txt │ │ ├── came.utils.plot.adata_embed_with_values.rst.txt │ │ ├── came.utils.plot.embed_with_values.rst.txt │ │ ├── came.utils.plot.heatmap_probas.rst.txt │ │ ├── came.utils.plot.plot_confus_mat.rst.txt │ │ ├── came.utils.plot.plot_contingency_mat.rst.txt │ │ ├── came.utils.plot.plot_multipartite_graph.rst.txt │ │ ├── came.utils.plot.plot_stacked_bar.rst.txt │ │ ├── came.utils.plot.umap_with_annotates.rst.txt │ │ ├── came.utils.plot.wrapper_heatmap_scores.rst.txt │ │ ├── came.utils.preprocess.align_adata_vars.rst.txt │ │ ├── came.utils.preprocess.get_homologies.rst.txt │ │ ├── came.utils.preprocess.group_mean.rst.txt │ │ ├── came.utils.preprocess.group_mean_adata.rst.txt │ │ ├── came.utils.preprocess.make_bipartite_adj.rst.txt │ │ ├── came.utils.preprocess.merge_adata_groups.rst.txt │ │ ├── came.utils.preprocess.normalize_default.rst.txt │ │ ├── came.utils.preprocess.quick_pre_vis.rst.txt │ │ ├── came.utils.preprocess.quick_preprocess.rst.txt │ │ ├── came.utils.preprocess.remove_adata_groups.rst.txt │ │ ├── came.utils.preprocess.split_adata.rst.txt │ │ ├── came.utils.preprocess.subset_matches.rst.txt │ │ ├── came.utils.preprocess.take_1v1_matches.rst.txt │ │ ├── came.utils.preprocess.take_adata_groups.rst.txt │ │ ├── came.utils.preprocess.wrapper_scale.rst.txt │ │ └── came.weight_linked_vars.rst.txt │ ├── index.rst.txt │ ├── installation.rst.txt │ ├── tut_notebooks │ │ ├── getting_started_pipeline_aligned.ipynb.txt │ │ ├── getting_started_pipeline_un.ipynb.txt │ │ └── load_results.ipynb.txt │ └── tutorials.rst.txt ├── _static │ ├── Fig1.png │ ├── Fig1ABC.png │ ├── Fig1D.png │ ├── basic.css │ ├── css │ │ ├── badge_only.css │ │ ├── fonts │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── lato-bold-italic.woff │ │ │ ├── lato-bold-italic.woff2 │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-normal-italic.woff │ │ │ ├── lato-normal-italic.woff2 │ │ │ ├── lato-normal.woff │ │ │ └── lato-normal.woff2 │ │ └── theme.css │ ├── doctools.js │ ├── documentation_options.js │ ├── file.png │ ├── fonts │ │ ├── Inconsolata-Bold.ttf │ │ ├── Inconsolata-Regular.ttf │ │ ├── Inconsolata.ttf │ │ ├── Lato-Bold.ttf │ │ ├── Lato-Regular.ttf │ │ ├── Lato │ │ │ ├── lato-bold.eot │ │ │ ├── lato-bold.ttf │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-bolditalic.eot │ │ │ ├── lato-bolditalic.ttf │ │ │ ├── lato-bolditalic.woff │ │ │ ├── lato-bolditalic.woff2 │ │ │ ├── lato-italic.eot │ │ │ ├── lato-italic.ttf │ │ │ ├── lato-italic.woff │ │ │ ├── lato-italic.woff2 │ │ │ ├── lato-regular.eot │ │ │ ├── lato-regular.ttf │ │ │ ├── lato-regular.woff │ │ │ └── lato-regular.woff2 │ │ ├── RobotoSlab-Bold.ttf │ │ ├── RobotoSlab-Regular.ttf │ │ ├── RobotoSlab │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ └── roboto-slab-v7-regular.woff2 │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── jquery-3.5.1.js │ ├── jquery.js │ ├── js │ │ ├── badge_only.js │ │ ├── html5shiv-printshiv.min.js │ │ ├── html5shiv.min.js │ │ ├── modernizr.min.js │ │ └── theme.js │ ├── language_data.js │ ├── minus.png │ ├── plus.png │ ├── pygments.css │ ├── searchtools.js │ ├── sphinx_highlight.js │ ├── underscore-1.13.1.js │ └── underscore.js ├── api.html ├── build │ ├── doctrees │ │ ├── api.doctree │ │ ├── citation.doctree │ │ ├── environment.pickle │ │ ├── generated │ │ │ ├── came.AlignedDataPair.doctree │ │ │ ├── came.CGCNet.doctree │ │ │ ├── came.CGGCNet.doctree │ │ │ ├── came.DataPair.doctree │ │ │ ├── came.aligned_datapair_from_adatas.doctree │ │ │ ├── came.datapair_from_adatas.doctree │ │ │ ├── came.pipeline.gather_came_results.doctree │ │ │ ├── came.pipeline.main_for_aligned.doctree │ │ │ ├── came.pipeline.main_for_unaligned.doctree │ │ │ ├── came.pipeline.preprocess_aligned.doctree │ │ │ ├── came.pipeline.preprocess_unaligned.doctree │ │ │ ├── came.utils.preprocess.align_adata_vars.doctree │ │ │ ├── came.utils.preprocess.group_mean_adata.doctree │ │ │ ├── came.utils.preprocess.normalize_default.doctree │ │ │ ├── came.utils.preprocess.quick_pre_vis.doctree │ │ │ ├── came.utils.preprocess.quick_preprocess.doctree │ │ │ └── came.utils.preprocess.wrapper_scale.doctree │ │ ├── index.doctree │ │ ├── installation.doctree │ │ └── tutorials.doctree │ └── html │ │ ├── .buildinfo │ │ ├── .nojekyll │ │ ├── _images │ │ ├── Fig1ABC.png │ │ └── Fig1D.png │ │ ├── _sources │ │ ├── api.rst.txt │ │ ├── citation.rst.txt │ │ ├── generated │ │ │ ├── came.AlignedDataPair.rst.txt │ │ │ ├── came.CGCNet.rst.txt │ │ │ ├── came.CGGCNet.rst.txt │ │ │ ├── came.DataPair.rst.txt │ │ │ ├── came.aligned_datapair_from_adatas.rst.txt │ │ │ ├── came.datapair_from_adatas.rst.txt │ │ │ ├── came.pipeline.gather_came_results.rst.txt │ │ │ ├── came.pipeline.main_for_aligned.rst.txt │ │ │ ├── came.pipeline.main_for_unaligned.rst.txt │ │ │ ├── came.pipeline.preprocess_aligned.rst.txt │ │ │ ├── came.pipeline.preprocess_unaligned.rst.txt │ │ │ ├── came.utils.preprocess.align_adata_vars.rst.txt │ │ │ ├── came.utils.preprocess.group_mean_adata.rst.txt │ │ │ ├── came.utils.preprocess.normalize_default.rst.txt │ │ │ ├── came.utils.preprocess.quick_pre_vis.rst.txt │ │ │ ├── came.utils.preprocess.quick_preprocess.rst.txt │ │ │ └── came.utils.preprocess.wrapper_scale.rst.txt │ │ ├── index.rst.txt │ │ ├── installation.rst.txt │ │ └── tutorials.rst.txt │ │ ├── _static │ │ ├── Fig1.png │ │ ├── Fig1ABC.png │ │ ├── Fig1D.png │ │ ├── basic.css │ │ ├── css │ │ │ ├── badge_only.css │ │ │ ├── fonts │ │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ ├── lato-bold-italic.woff │ │ │ │ ├── lato-bold-italic.woff2 │ │ │ │ ├── lato-bold.woff │ │ │ │ ├── lato-bold.woff2 │ │ │ │ ├── lato-normal-italic.woff │ │ │ │ ├── lato-normal-italic.woff2 │ │ │ │ ├── lato-normal.woff │ │ │ │ └── lato-normal.woff2 │ │ │ └── theme.css │ │ ├── doctools.js │ │ ├── documentation_options.js │ │ ├── file.png │ │ ├── js │ │ │ ├── badge_only.js │ │ │ ├── html5shiv-printshiv.min.js │ │ │ ├── html5shiv.min.js │ │ │ └── theme.js │ │ ├── language_data.js │ │ ├── minus.png │ │ ├── plus.png │ │ ├── pygments.css │ │ └── searchtools.js │ │ ├── api.html │ │ ├── citation.html │ │ ├── generated │ │ ├── came.AlignedDataPair.html │ │ ├── came.CGCNet.html │ │ ├── came.CGGCNet.html │ │ ├── came.DataPair.html │ │ ├── came.aligned_datapair_from_adatas.html │ │ ├── came.datapair_from_adatas.html │ │ ├── came.pipeline.gather_came_results.html │ │ ├── came.pipeline.main_for_aligned.html │ │ ├── came.pipeline.main_for_unaligned.html │ │ ├── came.pipeline.preprocess_aligned.html │ │ ├── came.pipeline.preprocess_unaligned.html │ │ ├── came.utils.preprocess.align_adata_vars.html │ │ ├── came.utils.preprocess.group_mean_adata.html │ │ ├── came.utils.preprocess.normalize_default.html │ │ ├── came.utils.preprocess.quick_pre_vis.html │ │ ├── came.utils.preprocess.quick_preprocess.html │ │ └── came.utils.preprocess.wrapper_scale.html │ │ ├── genindex.html │ │ ├── index.html │ │ ├── installation.html │ │ ├── objects.inv │ │ ├── py-modindex.html │ │ ├── search.html │ │ ├── searchindex.js │ │ └── tutorials.html ├── citation.html ├── faqs.html ├── generated │ ├── came.AlignedDataPair.html │ ├── came.CGCNet.html │ ├── came.CGGCNet.html │ ├── came.DataPair.html │ ├── came.aligned_datapair_from_adatas.html │ ├── came.datapair_from_adatas.html │ ├── came.load_dpair_and_model.html │ ├── came.load_example_data.html │ ├── came.load_hidden_states.html │ ├── came.load_pickle.html │ ├── came.make_abstracted_graph.html │ ├── came.make_features.html │ ├── came.pipeline.gather_came_results.html │ ├── came.pipeline.main_for_aligned.html │ ├── came.pipeline.main_for_unaligned.html │ ├── came.pipeline.preprocess_aligned.html │ ├── came.pipeline.preprocess_unaligned.html │ ├── came.save_hidden_states.html │ ├── came.save_pickle.html │ ├── came.utils.analyze.compare_modules.html │ ├── came.utils.analyze.compute_common_private.html │ ├── came.utils.analyze.make_abstracted_graph.html │ ├── came.utils.analyze.weight_linked_vars.html │ ├── came.utils.analyze.weight_linked_vars_by_expr.html │ ├── came.utils.plot.adata_embed_with_values.html │ ├── came.utils.plot.embed_with_values.html │ ├── came.utils.plot.heatmap_probas.html │ ├── came.utils.plot.plot_confus_mat.html │ ├── came.utils.plot.plot_contingency_mat.html │ ├── came.utils.plot.plot_multipartite_graph.html │ ├── came.utils.plot.plot_stacked_bar.html │ ├── came.utils.plot.umap_with_annotates.html │ ├── came.utils.plot.wrapper_heatmap_scores.html │ ├── came.utils.preprocess.align_adata_vars.html │ ├── came.utils.preprocess.change_names.html │ ├── came.utils.preprocess.get_homologies.html │ ├── came.utils.preprocess.get_homologues.html │ ├── came.utils.preprocess.group_mean.html │ ├── came.utils.preprocess.group_mean_adata.html │ ├── came.utils.preprocess.make_bipartite_adj.html │ ├── came.utils.preprocess.merge_adata_groups.html │ ├── came.utils.preprocess.normalize_default.html │ ├── came.utils.preprocess.quick_pre_vis.html │ ├── came.utils.preprocess.quick_preprocess.html │ ├── came.utils.preprocess.remove_adata_groups.html │ ├── came.utils.preprocess.split_adata.html │ ├── came.utils.preprocess.subset_matches.html │ ├── came.utils.preprocess.take_1v1_matches.html │ ├── came.utils.preprocess.take_adata_groups.html │ ├── came.utils.preprocess.wrapper_scale.html │ └── came.weight_linked_vars.html ├── genindex.html ├── index.html ├── installation.html ├── make.bat ├── objects.inv ├── pipe.sh ├── py-modindex.html ├── search.html ├── searchindex.js ├── source │ ├── _static │ │ ├── Fig1.png │ │ ├── Fig1ABC.png │ │ └── Fig1D.png │ ├── api.rst │ ├── citation.rst │ ├── conf.py │ ├── faqs.rst │ ├── generated │ │ ├── came.AlignedDataPair.rst │ │ ├── came.CGCNet.rst │ │ ├── came.CGGCNet.rst │ │ ├── came.DataPair.rst │ │ ├── came.aligned_datapair_from_adatas.rst │ │ ├── came.datapair_from_adatas.rst │ │ ├── came.load_dpair_and_model.rst │ │ ├── came.load_example_data.rst │ │ ├── came.load_hidden_states.rst │ │ ├── came.load_pickle.rst │ │ ├── came.make_features.rst │ │ ├── came.pipeline.gather_came_results.rst │ │ ├── came.pipeline.main_for_aligned.rst │ │ ├── came.pipeline.main_for_unaligned.rst │ │ ├── came.pipeline.preprocess_aligned.rst │ │ ├── came.pipeline.preprocess_unaligned.rst │ │ ├── came.save_hidden_states.rst │ │ ├── came.save_pickle.rst │ │ ├── came.utils.analyze.compare_modules.rst │ │ ├── came.utils.analyze.compute_common_private.rst │ │ ├── came.utils.analyze.make_abstracted_graph.rst │ │ ├── came.utils.analyze.weight_linked_vars.rst │ │ ├── came.utils.analyze.weight_linked_vars_by_expr.rst │ │ ├── came.utils.plot.adata_embed_with_values.rst │ │ ├── came.utils.plot.embed_with_values.rst │ │ ├── came.utils.plot.heatmap_probas.rst │ │ ├── came.utils.plot.plot_confus_mat.rst │ │ ├── came.utils.plot.plot_contingency_mat.rst │ │ ├── came.utils.plot.plot_multipartite_graph.rst │ │ ├── came.utils.plot.plot_stacked_bar.rst │ │ ├── came.utils.plot.umap_with_annotates.rst │ │ ├── came.utils.plot.wrapper_heatmap_scores.rst │ │ ├── came.utils.preprocess.align_adata_vars.rst │ │ ├── came.utils.preprocess.get_homologies.rst │ │ ├── came.utils.preprocess.group_mean.rst │ │ ├── came.utils.preprocess.group_mean_adata.rst │ │ ├── came.utils.preprocess.make_bipartite_adj.rst │ │ ├── came.utils.preprocess.merge_adata_groups.rst │ │ ├── came.utils.preprocess.normalize_default.rst │ │ ├── came.utils.preprocess.quick_pre_vis.rst │ │ ├── came.utils.preprocess.quick_preprocess.rst │ │ ├── came.utils.preprocess.remove_adata_groups.rst │ │ ├── came.utils.preprocess.split_adata.rst │ │ ├── came.utils.preprocess.subset_matches.rst │ │ ├── came.utils.preprocess.take_1v1_matches.rst │ │ ├── came.utils.preprocess.take_adata_groups.rst │ │ ├── came.utils.preprocess.wrapper_scale.rst │ │ └── came.weight_linked_vars.rst │ ├── index.rst │ ├── installation.rst │ ├── tut_notebooks │ │ ├── getting_started_pipeline_aligned.ipynb │ │ ├── getting_started_pipeline_un.ipynb │ │ └── load_results.ipynb │ └── tutorials.rst ├── tut_notebooks │ ├── getting_started_pipeline_aligned.html │ ├── getting_started_pipeline_aligned.ipynb │ ├── getting_started_pipeline_un.html │ ├── getting_started_pipeline_un.ipynb │ ├── load_results.html │ └── load_results.ipynb └── tutorials.html ├── pyproject.toml ├── requirements.txt ├── setup.py └── test_pipeline.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .DS_Store 3 | .ipynb_checkpoints/ 4 | 5 | __pycache__ 6 | *.pyc 7 | 8 | _temp 9 | /_case_res/ 10 | /came_res/ 11 | gitpush.sh 12 | 13 | /came/sample_data/ 14 | 15 | /notebooks/* 16 | /notebooks/.ipynb_checkpoints 17 | 18 | /DATASET_NAMES.py 19 | /_tmp* 20 | code_test* 21 | 22 | # Distribution / packaging 23 | .Python 24 | build/ 25 | *.egg-info/ 26 | dist/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Cynthia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include ./came/sample_data.zip 2 | include README.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CAME 2 | [![DOI](https://zenodo.org/badge/367772907.svg)](https://zenodo.org/badge/latestdoi/367772907) 3 | 4 | **English** | [简体中文](README_CH.md) 5 | 6 | CAME is a tool for **Cell-type Assignment and Module Extraction**, based on a heterogeneous graph neural network. 7 | 8 | For detailed usage, please refer to [CAME-Documentation](https://xingyanliu.github.io/CAME/index.html). 9 | 10 | 11 | 12 | CAME outputs the quantitative cell-type assignment for each query cell, that is, 13 | the probabilities of cell types that exist in the reference species, which 14 | enables the identification of the unresolved cell states in the query data. 15 | 16 | Besides, CAME gives the aligned cell and gene embeddings across species, which 17 | facilitates low-dimensional visualization and joint gene-module extraction. 18 | 19 | 20 | 21 | 22 | ### Installation 23 | 24 | It's recommended to create a conda environment for running CAME: 25 | 26 | ```shell 27 | conda create -n env_came python=3.8 28 | conda activate env_came 29 | ``` 30 | 31 | Install required packages: 32 | 33 | ```shell 34 | # on CPU 35 | pip install "scanpy[leiden]" 36 | pip install torch # >=1.8 37 | pip install dgl # tested on 0.7.2, better below 1.0.* 38 | ``` 39 | 40 | See [Scanpy](https://scanpy.readthedocs.io/en/stable/), 41 | [PyTorch](https://pytorch.org/) and [DGL](https://www.dgl.ai/) 42 | for detailed installation guide (especially for GPU version). 43 | 44 | 45 | Install CAME by PyPI: 46 | 47 | ```shell 48 | pip install came 49 | ``` 50 | 51 | Install the developmental version of CAME from source code: 52 | 53 | ```shell 54 | git clone https://github.com/XingyanLiu/CAME.git 55 | cd CAME 56 | python setup.py install 57 | ``` 58 | 59 | ### Example data 60 | 61 | The test code is based on the sample data attached to the CAME package. 62 | It is initially saved in compressed form (`CAME/came/sample_data.zip`), 63 | and will be automatically decompressed to the default directory 64 | (`CAME/came/sample_data/`) when necessary, which contains the following files: 65 | 66 | - gene_matches_1v1_human2mouse.csv (optional) 67 | - gene_matches_1v1_mouse2human.csv (optional) 68 | - gene_matches_human2mouse.csv 69 | - gene_matches_mouse2human.csv 70 | - raw-Baron_mouse.h5ad 71 | - raw-Baron_human.h5ad 72 | 73 | You can access these data by ``came.load_example_data()``. 74 | 75 | If you tend to apply CAME to analyze your own datasets, you need to 76 | prepare at least the last two files for the same species (e.g., cross-dataset 77 | integration); 78 | 79 | For cross-species analysis, you need to provide another `.csv` 80 | file where the first column contains the genes in the reference species and the 81 | second contains the corresponding query homologous genes. 82 | 83 | 84 | > NOTE: 85 | > the file `raw-Baron_human.h5ad` is a subsample from the original data 86 | > for code testing. The resulting annotation accuracy may not be as good as 87 | > using the full dataset as the reference. 88 | 89 | **Suggestions** 90 | > 91 | > If you have sufficient GPU memory, setting the hidden-size `h_dim=512` 92 | in "came/PARAMETERS.py" may result in a more accurate cell-type transfer. 93 | 94 | ### Test CAME's pipeline (optional) 95 | 96 | To test the package, run the python file `test_pipeline.py`: 97 | 98 | ```python 99 | # test_pipeline.py 100 | import came 101 | 102 | if __name__ == '__main__': 103 | came.__test1__(6, batch_size=2048) 104 | came.__test2__(6, batch_size=None) 105 | ``` 106 | 107 | ```shell 108 | python test_pipeline.py 109 | ``` 110 | 111 | ### Contribute 112 | 113 | * Issue Tracker: https://github.com/XingyanLiu/CAME/issues 114 | * Source Code: 115 | * https://github.com/zhanglabtools/CAME 116 | * https://github.com/XingyanLiu/CAME (the developmental version) 117 | 118 | ### Support 119 | 120 | If you are having issues, please let us know. We have a mailing list located at: 121 | 122 | * 544568643@qq.com 123 | * xingyan@amss.ac.cn 124 | 125 | 126 | ### Citation 127 | 128 | If CAME is useful for your research, consider citing our work: 129 | 130 | > Liu X, Shen Q, Zhang S. Cross-species cell-type assignment of single-cell RNA-seq by a heterogeneous graph neural network[J]. Genome Research, 2022: gr. 276868.122. 131 | 132 | > Preprint: https://doi.org/10.1101/2021.09.25.461790 133 | 134 | -------------------------------------------------------------------------------- /README_CH.md: -------------------------------------------------------------------------------- 1 | # CAME 2 | [![DOI](https://zenodo.org/badge/367772907.svg)](https://zenodo.org/badge/latestdoi/367772907) 3 | 4 | [English](README.md) | **简体中文** 5 | 6 | CAME 是一个基于异质图神经网络的 **细胞类型注释和基因模块提取** 的工具。 7 | 8 | 有关详细用法,请参阅 [CAME-文档](https://xingyanliu.github.io/CAME/index.html). 9 | 10 | 11 | 12 | 对查询数据集的每个细胞,CAME 可以输出其细胞类型的量化估计,即对应于参考数据中的细胞类型概率, 13 | 从而能帮助够识别查询数据中的潜在未知细胞类型。 14 | 15 | 此外,CAME 还提供了跨物种对齐的细胞和基因嵌入表示,有助于进一步的低维可视化和联合基因模块提取。 16 | (如图所示) 17 | 18 | 19 | 20 | 21 | ### 安装 22 | 23 | 推荐使用 Conda 新建一个 Python 环境来运行 CAME: 24 | 25 | ```shell 26 | conda create -n env_came python=3.8 27 | conda activate env_came 28 | ``` 29 | 30 | 安装必要的依赖包: 31 | 32 | ```shell 33 | pip install "scanpy[leiden]" 34 | pip install torch # >=1.8 35 | pip install dgl # better below 1.0.* 36 | ``` 37 | 38 | See [Scanpy](https://scanpy.readthedocs.io/en/stable/), 39 | [PyTorch](https://pytorch.org/) and [DGL](https://www.dgl.ai/) 40 | for detailed installation guide (especially for GPU version). 41 | 42 | 从 PyPI 安装 CAME: 43 | 44 | ```shell 45 | pip install came 46 | ``` 47 | 48 | 从源代码中安装 CAME 的开发版本: 49 | 50 | ```shell 51 | git clone https://github.com/XingyanLiu/CAME.git 52 | cd CAME 53 | python setup.py install 54 | ``` 55 | 56 | ### 样例数据 57 | 58 | 测试代码和文档中的分析示例都基于CAME包附带的样例数据,初始时以压缩形式保存 (`./came/sample_data.zip`), 59 | 在需要的时候会自动解压到默认目录下 (`./came/sample_data/`),其中包含以下文件: 60 | 61 | - gene_matches_1v1_human2mouse.csv (非必要) 62 | - gene_matches_1v1_mouse2human.csv (非必要) 63 | - gene_matches_human2mouse.csv 64 | - gene_matches_mouse2human.csv 65 | - raw-Baron_mouse.h5ad 66 | - raw-Baron_human.h5ad 67 | 68 | 如果你需要用 CAME 来分析你自己的数据集,同物种的跨数据(跨组学)分析至少要准备以上后两个文件(基因表达count)。 69 | 70 | 对于跨物种分析,您需要提供另一个“.csv”文件,其中第一列包含参考物种中的基因,第二列包含相应的查询同源基因。 71 | 72 | > 注意: 73 | > 数据文件 “raw-Baron_human.h5ad” 仅用于代码测试,是原始数据的子样本 (20%), 74 | > 因此结果的注释精度可能不如使用完整数据集作为参考。 75 | 76 | ### **建议** 77 | 78 | 如果你有足够的GPU显存,我们建议在``came/PARAMETERS.py``中设置`h_dim=512` 来获得更好的结果。 79 | 80 | ### 测试 CAME 的分析流程 (非必要) 81 | 82 | 可以直接运行 `test_pipeline.py` 来测试 CAME 的分析流程: 83 | 84 | ```python 85 | # test_pipeline.py 86 | import came 87 | 88 | if __name__ == '__main__': 89 | came.__test1__(6, batch_size=2048) 90 | came.__test2__(6, batch_size=None) 91 | ``` 92 | 93 | ```shell 94 | python test_pipeline.py 95 | ``` 96 | 97 | 如果测试过程中没有报错,那就放心使用CAME吧~ 98 | 99 | ### Contribute 100 | 101 | * 问题追踪: https://github.com/XingyanLiu/CAME/issues 102 | * 源代码: 103 | * https://github.com/zhanglabtools/CAME 104 | * https://github.com/XingyanLiu/CAME (the developmental version) 105 | 106 | ### Support 107 | 108 | 如果你有其他问题,也可以通过邮箱联系我们: 109 | 110 | * 544568643@qq.com 111 | * xingyan@amss.ac.cn 112 | 113 | 114 | ### 引用 115 | 116 | 如果 CAME 对你的研究有帮助,可以引用我们的预印本哦~ 117 | 118 | > Cross-species cell-type assignment of single-cell RNA-seq by a heterogeneous graph neural network. 119 | Xingyan Liu, Qunlun Shen, Shihua Zhang. 120 | bioRxiv 2021.09.25.461790; doi: https://doi.org/10.1101/2021.09.25.461790 121 | 122 | -------------------------------------------------------------------------------- /came/PARAMETERS.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Apr 11 22:13:17 2021 4 | 5 | @author: Xingyan Liu 6 | 7 | Parameter Settings 8 | 9 | Notes 10 | ----- 11 | * Do NOT change this file directly! 12 | 13 | Examples 14 | -------- 15 | >>> params_pre = PARAMETER.get_preprocess_params() 16 | >>> params_model = PARAMETER.get_model_params() 17 | >>> params_loss = PARAMETER.get_loss_params() 18 | 19 | """ 20 | import copy 21 | 22 | # _params_pre = dict( 23 | # remove_rare=False, # True for benchmarking; False for case study 24 | # min_samples=10, 25 | # ### 26 | # norm__rev=False, # False by default 27 | # norm__log_only=False, # False by default 28 | # ### 29 | # scale_within=True, # True by default 30 | # unit_var=True, # True by default 31 | # clip=not True, clip_range=(-3, 5), # False by default 32 | # ### 33 | # use_degs=True, 34 | # only_1v1homo=False, # False by default 35 | # target_sum='auto', # auto --> 1e4 36 | # with_single_vnodes=not True, 37 | # ) 38 | 39 | _params_model = dict( 40 | h_dim=128, 41 | num_hidden_layers=2, 42 | norm='right', 43 | dropout_feat=0.0, # no dropout for cell input features 44 | dropout=0.2, 45 | negative_slope=0.05, 46 | layernorm_ntypes=['cell', 'gene'], 47 | out_bias=True, 48 | rel_names_out=[('gene', 'expressed_by', 'cell'), 49 | ], 50 | share_hidden_weights=True, 51 | attn_out=True, 52 | kwdict_outgat=dict(n_heads=8, 53 | feat_drop=0.01, 54 | attn_drop=0.6, 55 | negative_slope=0.2, 56 | residual=False, 57 | attn_type='add', # 'add' is more robust than 'mul' 58 | heads_fuse='mean', 59 | ), 60 | share_layernorm=True, # ignored if no weights are shared 61 | residual=False, # performance un-tested 62 | ) 63 | 64 | _params_lossfunc = dict( 65 | smooth_eps=0.1, reduction='mean', 66 | beta=1., # balance factor for multi-label loss 67 | alpha=0, # for R-drop, setting it larger than zero 68 | ) 69 | 70 | 71 | def _get_parameter_dict(default={}, **kwds) -> dict: 72 | params = copy.deepcopy(default) 73 | if len(kwds) > 0: 74 | params.update(**kwds) 75 | return params 76 | 77 | 78 | # def get_preprocess_params(**kwds) -> dict: 79 | # return _get_parameter_dict(_params_pre, **kwds) 80 | 81 | 82 | def get_loss_params(**kwds) -> dict: 83 | return _get_parameter_dict(_params_lossfunc, **kwds) 84 | 85 | 86 | def get_model_params(kwdict_outgat={}, **kwds) -> dict: 87 | params = _get_parameter_dict(_params_model, **kwds) 88 | if len(kwdict_outgat) > 0: 89 | params['kwdict_outgat'].update(kwdict_outgat) 90 | return params 91 | 92 | -------------------------------------------------------------------------------- /came/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @author: Xingyan Liu 3 | 4 | from .utils import ( 5 | load_hidden_states, 6 | save_hidden_states, 7 | load_example_data 8 | ) 9 | from .utils import base 10 | from .utils.base import ( 11 | save_pickle, 12 | load_pickle, 13 | save_json_dict, 14 | load_json_dict, 15 | check_dirs, 16 | write_info, 17 | make_nowtime_tag, 18 | subsample_each_group, 19 | ) 20 | from .utils import preprocess as pp 21 | from .utils import plot as pl 22 | from .utils import analyze as ana 23 | from .utils.analyze import ( 24 | load_dpair_and_model, 25 | weight_linked_vars, 26 | make_abstracted_graph, 27 | ) 28 | from .utils.train import prepare4train, Trainer, SUBDIR_MODEL 29 | from .utils._base_trainer import get_checkpoint_list 30 | from .utils.evaluation import accuracy 31 | from .model import ( 32 | Predictor, 33 | detach2numpy, 34 | as_probabilities, 35 | predict_from_logits, 36 | predict, 37 | CGGCNet, 38 | CGCNet 39 | ) 40 | from .datapair import ( 41 | datapair_from_adatas, 42 | aligned_datapair_from_adatas, 43 | DataPair, 44 | AlignedDataPair, 45 | make_features, 46 | ) 47 | from .PARAMETERS import get_model_params, get_loss_params 48 | from . import pipeline 49 | from .pipeline import KET_CLUSTER, __test1__, __test2__ 50 | 51 | 52 | __version__ = "0.1.12" 53 | -------------------------------------------------------------------------------- /came/datapair/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Dec 27 21:59:44 2020 4 | 5 | @author: Xingyan Liu 6 | """ 7 | 8 | from .unaligned import datapair_from_adatas, DataPair, make_features 9 | from .aligned import aligned_datapair_from_adatas, AlignedDataPair 10 | 11 | -------------------------------------------------------------------------------- /came/model/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Dec 27 21:59:44 2020 4 | 5 | @author: Xingyan Liu 6 | """ 7 | 8 | from ._utils import * 9 | from ._predict import * 10 | from .loss import * 11 | from ._predict import * 12 | from .loss import * 13 | from .cggc import CGGCNet 14 | from .cgc import CGCNet 15 | -------------------------------------------------------------------------------- /came/model/_minibatch.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | """ 3 | @CreateDate: 2021/07/15 4 | @Author: Qunlun Shen 5 | @File: _minibatch.py 6 | @Project: CAME 7 | """ 8 | from pathlib import Path 9 | from typing import Sequence, Union, Mapping, Optional 10 | import time 11 | import numpy as np 12 | import torch 13 | from torch import Tensor 14 | import dgl 15 | import tqdm 16 | 17 | 18 | def make_fanouts(etypes, etypes_each_layers, k_each_etype: Union[int, dict]): 19 | if isinstance(k_each_etype, int): 20 | k_each_etype = dict.fromkeys(etypes, k_each_etype) 21 | 22 | fanouts = [] 23 | for _etypes in etypes_each_layers: 24 | _fanout = dict.fromkeys(etypes, 0) 25 | _fanout.update({e: k_each_etype[e] for e in _etypes}) 26 | fanouts.append(_fanout) 27 | return fanouts 28 | 29 | 30 | def involved_nodes(g,) -> dict: 31 | """ collect all the involved nodes from the edges on g 32 | (a heterogeneous graph) 33 | 34 | Examples 35 | -------- 36 | 37 | >>> input_nodes, output_nodes, mfgs = next(iter(train_dataloader)) 38 | >>> g.subgraph(involved_nodes(mfgs[0])) 39 | 40 | """ 41 | from collections import defaultdict 42 | nodes = defaultdict(set) 43 | for stype, etype, dtype in g.canonical_etypes: 44 | src, dst = g.edges(etype=etype) 45 | nodes[stype].update(src.numpy()) 46 | nodes[dtype].update(dst.numpy()) 47 | 48 | nodes = {k: sorted(v) for k, v in nodes.items()} 49 | return nodes 50 | 51 | -------------------------------------------------------------------------------- /came/model/v0/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Dec 27 21:59:44 2020 4 | 5 | @author: Xingyan Liu 6 | """ 7 | 8 | from ._utils import * 9 | from ._predict import * 10 | from .loss import * 11 | from ._predict import * 12 | from .loss import * 13 | from .cggc import CGGCNet 14 | from .cgc import CGCNet 15 | -------------------------------------------------------------------------------- /came/model/v0/_minibatch.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | """ 3 | @CreateDate: 2021/07/15 4 | @Author: Qunlun Shen 5 | @File: _minibatch.py 6 | @Project: CAME 7 | """ 8 | from pathlib import Path 9 | from typing import Sequence, Union, Mapping, Optional 10 | import time 11 | import numpy as np 12 | import torch 13 | from torch import Tensor 14 | import dgl 15 | import tqdm 16 | 17 | 18 | def sub_graph(cell_ids, gene_ids, g): 19 | """ 20 | Making sub_graph for g with input cell_ids and gene_ids 21 | """ 22 | output_nodes_dict = {'cell': cell_ids, 'gene': gene_ids} 23 | g_subgraph = dgl.node_subgraph(g, output_nodes_dict) 24 | return g_subgraph 25 | 26 | 27 | def create_blocks(g, output_nodes, etype='expressed_by'): 28 | cell_ids = output_nodes.clone().detach() 29 | gene_ids = g.in_edges(cell_ids, etype=etype)[0] # genes expressed_by cells 30 | gene_ids = torch.unique(gene_ids) 31 | block = sub_graph(cell_ids, gene_ids, g) # graph for GAT 32 | return block 33 | 34 | 35 | def create_batch( 36 | sample_size=None, 37 | train_idx=None, 38 | test_idx=None, 39 | batch_size=None, 40 | labels=None, 41 | shuffle=True, 42 | label=True 43 | ): 44 | """ 45 | This function create batch idx, i.e. the cells IDs in a batch. 46 | 47 | Parameters 48 | ---------- 49 | train_idx: 50 | the index for reference cells 51 | test_idx: 52 | the index for query cells 53 | batch_size: 54 | the number of cells in each batch 55 | labels: 56 | the labels for both Reference cells and Query cells 57 | 58 | Returns 59 | ------- 60 | train_labels 61 | the shuffled or non-shuffled labels for all reference cells 62 | test_labels 63 | the shuffled or non-shuffled labels for all query cells 64 | batch_list 65 | the list sores the batch of cell IDs 66 | all_idx 67 | the shuffled or non-shuffled index for all cells 68 | """ 69 | if label: 70 | batch_list = [] 71 | batch_labels = [] 72 | sample_size = len(train_idx) + len(test_idx) 73 | if shuffle: 74 | all_idx = torch.randperm(sample_size) 75 | shuffled_labels = labels[all_idx] 76 | train_labels = shuffled_labels[all_idx < len(train_idx)].clone().detach() 77 | test_labels = shuffled_labels[all_idx >= len(train_idx)].clone().detach() 78 | 79 | if batch_size >= sample_size: 80 | batch_list.append(all_idx) 81 | 82 | else: 83 | batch_num = int(len(all_idx) / batch_size) + 1 84 | for i in range(batch_num - 1): 85 | batch_list.append(all_idx[batch_size * i: batch_size * (i + 1)]) 86 | batch_list.append(all_idx[batch_size * (batch_num - 1):]) 87 | 88 | else: 89 | train_labels = labels[train_idx].clone().detach() 90 | test_labels = labels[test_idx].clone().detach() 91 | all_idx = torch.cat((train_idx, test_idx), 0) 92 | if batch_size >= sample_size: 93 | batch_list.append(all_idx) 94 | else: 95 | batch_num = int(len(all_idx) / batch_size) + 1 96 | for i in range(batch_num - 1): 97 | batch_list.append(all_idx[batch_size * i: batch_size * (i + 1)]) 98 | batch_labels.append(labels[batch_size * i: batch_size * (i + 1)]) 99 | batch_list.append(all_idx[batch_size * (batch_num - 1):]) 100 | 101 | return train_labels, test_labels, batch_list, all_idx 102 | 103 | else: 104 | batch_list = [] 105 | if shuffle: 106 | all_idx = torch.randperm(sample_size) 107 | 108 | if batch_size >= sample_size: 109 | batch_list.append(all_idx) 110 | else: 111 | batch_num = int(len(all_idx) / batch_size) + 1 112 | for i in range(batch_num - 1): 113 | batch_list.append(all_idx[batch_size * i: batch_size * (i + 1)]) 114 | batch_list.append(all_idx[batch_size * (batch_num - 1):]) 115 | 116 | else: 117 | all_idx = torch.arange(sample_size) 118 | if batch_size >= sample_size: 119 | batch_list.append(all_idx) 120 | else: 121 | batch_num = int(len(all_idx) / batch_size) + 1 122 | for i in range(batch_num - 1): 123 | batch_list.append(all_idx[batch_size * i: batch_size * (i + 1)]) 124 | batch_list.append(all_idx[batch_size * (batch_num - 1):]) 125 | 126 | return batch_list, all_idx, None, None 127 | 128 | -------------------------------------------------------------------------------- /came/sample_data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/came/sample_data.zip -------------------------------------------------------------------------------- /came/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Dec 27 21:59:44 2020 4 | 5 | @author: Xingyan Liu 6 | """ 7 | from . import * 8 | from .base import ( 9 | save_pickle, 10 | load_pickle, 11 | check_dirs, 12 | write_info, 13 | make_nowtime_tag, 14 | subsample_each_group, 15 | ) 16 | from .evaluation import accuracy 17 | from .analyze import ( 18 | weight_linked_vars, 19 | make_abstracted_graph, 20 | ) 21 | from ._get_example_data import load_example_data 22 | from .downsample_counts import ( 23 | downsample_total_counts, 24 | downsample_counts_per_cell 25 | ) 26 | from ._io_h5py import load_hidden_states, save_hidden_states 27 | -------------------------------------------------------------------------------- /came/utils/_get_example_data.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | """ 3 | @author: Xingyan Liu 4 | @file: _get_example_data.py 5 | @time: 2021-06-12 6 | """ 7 | 8 | import os 9 | from pathlib import Path 10 | from typing import Sequence, Union, Dict, List, Optional # , Callable 11 | import numpy as np 12 | import pandas as pd 13 | import scanpy as sc 14 | from scipy import sparse 15 | import logging 16 | 17 | CAME_ROOT = Path(__file__).parents[1] 18 | 19 | 20 | def _extract_zip( 21 | fp_zip=CAME_ROOT / 'sample_data.zip', 22 | fp_unzip=CAME_ROOT / 'sample_data', 23 | ): 24 | import zipfile 25 | with zipfile.ZipFile(fp_zip) as zipf: 26 | zipf.extractall(fp_unzip) 27 | 28 | 29 | def load_example_data() -> Dict: 30 | """ Load example data, for a quick start with CAME. 31 | 32 | This pair of cross-species datasets contains the pancreatic scRNA-seq data 33 | of human ("Baron_human") and mouse ("Baron_human"), 34 | initially published with paper [1]. 35 | 36 | NOTE that "Baron_human" is a 20%-subsample from the original data. 37 | The resulting cell-typing accuracy may not be as good as one 38 | using full dataset as the reference. 39 | 40 | [1] Baron, M. et al. (2016) A Single-Cell Transcriptomic Map of the Human 41 | and Mouse Pancreas Reveals Inter- and Intra-cell Population Structure. 42 | Cell Syst 3 (4), 346-360.e4. 43 | 44 | Returns 45 | ------- 46 | dict: 47 | a dict with keys ['adatas', 'varmap', 'varmap_1v1', 'dataset_names', 'key_class'] 48 | 49 | Examples 50 | -------- 51 | >>> example_data_dict = load_example_data() 52 | >>> print(example_data_dict.keys()) 53 | # Out[]: dict_keys(['adatas', 'varmap', 'varmap_1v1', 'dataset_names', 'key_class']) 54 | 55 | >>> adatas = example_data_dict['adatas'] 56 | >>> dsnames = example_data_dict['dataset_names'] # ('Baron_human', 'Baron_mouse') 57 | >>> df_varmap = example_data_dict['varmap'] 58 | >>> df_varmap_1v1 = example_data_dict['varmap_1v1'] 59 | >>> key_class1 = key_class2 = example_data_dict['key_class'] 60 | 61 | """ 62 | datadir = CAME_ROOT / 'sample_data' 63 | 64 | sp1, sp2 = ('human', 'mouse') 65 | dsnames = ('Baron_human', 'Baron_mouse') 66 | dsn1, dsn2 = dsnames 67 | fp1, fp2 = datadir / f'raw-{dsn1}.h5ad', datadir / f'raw-{dsn2}.h5ad' 68 | fp_varmap_1v1 = datadir / f'gene_matches_1v1_{sp1}2{sp2}.csv' 69 | fp_varmap = datadir / f'gene_matches_{sp1}2{sp2}.csv' 70 | 71 | if not (datadir.exists() and fp1.exists() and fp2.exists() and 72 | fp_varmap.exists() and fp_varmap_1v1.exists()): 73 | _extract_zip() 74 | 75 | df_varmap_1v1 = pd.read_csv(fp_varmap_1v1, ) 76 | df_varmap = pd.read_csv(fp_varmap, ) 77 | 78 | adata_raw1, adata_raw2 = sc.read_h5ad(fp1), sc.read_h5ad(fp2) 79 | 80 | key_class = 'cell_ontology_class' 81 | example_dict = { 82 | 'adatas': [adata_raw1, adata_raw2], 83 | 'varmap': df_varmap, 84 | 'varmap_1v1': df_varmap_1v1, 85 | 'dataset_names': dsnames, 86 | 'key_class': key_class, 87 | } 88 | logging.info(example_dict.keys()) 89 | logging.debug(example_dict) 90 | return example_dict 91 | 92 | 93 | if __name__ == '__main__': 94 | logging.basicConfig( 95 | level=logging.DEBUG, 96 | format='%(asctime)s %(filename)s-%(lineno)d-%(funcName)s(): ' 97 | '%(levelname)s\n %(message)s') 98 | d = load_example_data() 99 | print(d.keys()) 100 | -------------------------------------------------------------------------------- /came/utils/_io_h5py.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | """ 3 | @Author: Xingyan Liu 4 | @File: _tmp_h5py.py 5 | @Date: 2021-08-03 6 | @Project: CAME 7 | """ 8 | import os 9 | from pathlib import Path 10 | from typing import Union, Optional, List, Mapping 11 | import logging 12 | import numpy as np 13 | import h5py 14 | 15 | 16 | def save_hidden_states(data_list: List, path: Union[Path, str]): 17 | """ Save hidden states into .h5 file 18 | 19 | Parameters 20 | ---------- 21 | data_list 22 | a list of data matrix, or a list of dicts whose values are matrices 23 | path 24 | file-path ends with .h5, if not, '.h5' will be appended to it. 25 | 26 | Returns 27 | ------- 28 | None 29 | """ 30 | if not str(path).endswith('.h5'): 31 | path = str(path) + '.h5' 32 | f = h5py.File(path, 'w') 33 | if isinstance(data_list[0], dict): 34 | for i, dct in enumerate(data_list): 35 | for key, _data in dct.items(): 36 | f.create_dataset(f'/layer{i}/{key}', data=_data) 37 | else: 38 | for i, _data in enumerate(data_list): 39 | f.create_dataset(f'/layer{i}', data=_data) 40 | 41 | f.close() 42 | 43 | 44 | def load_hidden_states(path) -> List[dict]: 45 | """ Load hidden states from .h5 file 46 | the data structure should be like 47 | [ 48 | 'layer0/cell', 'layer0/gene', 49 | 'layer1/cell', 'layer1/gene', 50 | 'layer2/cell', 'layer2/gene' 51 | ] 52 | 53 | Parameters 54 | ---------- 55 | path 56 | .h5 file path 57 | 58 | Returns 59 | ------- 60 | values: a list of dicts 61 | """ 62 | f = h5py.File(path, 'r') 63 | prefix = 'layer' 64 | keys = sorted(f.keys(), key=lambda x: int(x.strip(prefix))) 65 | # print(keys) 66 | values = [_unfold_to_dict(f[key]) for key in keys] 67 | return values 68 | 69 | 70 | def _unfold_to_dict(d: h5py.Group) -> dict: 71 | dct = {} 72 | for key, val in d.items(): 73 | if isinstance(val, h5py.Dataset): 74 | dct[key] = np.array(val) 75 | return dct 76 | 77 | 78 | def _visit(f: h5py.File): 79 | tree = [] 80 | 81 | def foo(_name, _obj): 82 | if isinstance(_obj, h5py.Dataset): 83 | tree.append(_name) 84 | f.visititems(foo) 85 | logging.info(f'tree={tree}') 86 | return tree 87 | 88 | 89 | def __test__(): 90 | n_cells = 100 91 | n_genes = 114 92 | n_dims = 64 93 | hidden_data = [ 94 | {'cell': np.random.randn(n_cells, n_dims), 95 | 'gene': np.random.randn(n_genes, n_dims)} 96 | for i in range(3) 97 | ] 98 | hidden_data.append({'cell': np.random.randn(n_cells, n_dims)}) 99 | 100 | # logging.debug(hidden_data) 101 | save_hidden_states(hidden_data, '_tmp_data') 102 | f1 = h5py.File('_tmp_data.h5', 'r') 103 | h_list = load_hidden_states('../../_tmp_data.h5') 104 | # logging.info(values) 105 | for k, d in zip(f1.keys(), h_list): 106 | print(f'{k}: {list(d.keys())}') 107 | 108 | 109 | if __name__ == '__main__': 110 | logging.basicConfig( 111 | level=logging.DEBUG, 112 | format='%(asctime)s %(filename)s-%(lineno)d-%(funcName)s(): ' 113 | '%(levelname)s\n %(message)s') 114 | __test__() 115 | -------------------------------------------------------------------------------- /came/utils/evaluation.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Apr 11 19:43:10 2021 4 | 5 | @author: Xingyan Liu 6 | """ 7 | 8 | import numpy as np 9 | from sklearn import metrics 10 | import torch 11 | from torch import Tensor 12 | from typing import Sequence 13 | from ..model import detach2numpy 14 | 15 | 16 | def accuracy(logits: Tensor, labels: Tensor): 17 | labels = labels.to(logits.device) 18 | if len(logits.shape) >= 2: 19 | _, preds = torch.max(logits, dim=1) 20 | else: 21 | preds = logits 22 | if len(labels.shape) >= 2: 23 | _, labels = torch.max(labels, dim=1) 24 | else: 25 | labels = labels 26 | correct = torch.sum(preds == labels) 27 | return correct.item() * 1.0 / len(labels) 28 | 29 | 30 | def get_AMI(y_true, y_pred, **kwds): 31 | y_true, y_pred = list(map(detach2numpy, (y_true, y_pred))) 32 | ami = metrics.adjusted_mutual_info_score(y_true, y_pred, **kwds) 33 | return ami 34 | 35 | 36 | def get_F1_score(y_true, y_pred, average='macro', **kwds): 37 | y_true, y_pred = list(map(detach2numpy, (y_true, y_pred))) 38 | f1 = metrics.f1_score(y_true, y_pred, average=average, **kwds) 39 | return f1 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/.nojekyll -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: jekyll-theme-cayman 2 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/_images/Fig1ABC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/Fig1ABC.png -------------------------------------------------------------------------------- /docs/_images/Fig1D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/Fig1D.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_aligned_16_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_aligned_16_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_aligned_18_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_aligned_18_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_aligned_22_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_aligned_22_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_aligned_22_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_aligned_22_3.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_17_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_17_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_19_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_19_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_23_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_23_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_23_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_23_3.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_29_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_29_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_30_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_30_0.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_32_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_32_1.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_32_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_32_3.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_39_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_39_0.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_40_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_40_0.png -------------------------------------------------------------------------------- /docs/_images/tut_notebooks_getting_started_pipeline_un_43_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_images/tut_notebooks_getting_started_pipeline_un_43_1.png -------------------------------------------------------------------------------- /docs/_sources/api.rst.txt: -------------------------------------------------------------------------------- 1 | .. module:: came 2 | .. automodule:: came 3 | :noindex: 4 | 5 | API References 6 | ============== 7 | 8 | 9 | Import CAME: 10 | 11 | .. code:: ipython3 12 | 13 | import came 14 | 15 | Example data 16 | ------------ 17 | 18 | .. module:: came 19 | 20 | .. autosummary:: 21 | :toctree: generated/ 22 | 23 | load_example_data 24 | 25 | 26 | Pipeline ``came.pipeline.*`` 27 | ---------------------------- 28 | 29 | .. module:: came.pipeline 30 | .. :currentmodule:: came 31 | 32 | .. autosummary:: 33 | :toctree: generated/ 34 | 35 | main_for_aligned 36 | main_for_unaligned 37 | preprocess_aligned 38 | preprocess_unaligned 39 | gather_came_results 40 | 41 | Preprocessing ``came.pp.*`` 42 | --------------------------- 43 | 44 | .. module:: came.utils.preprocess 45 | .. :currentmodule:: came 46 | 47 | .. autosummary:: 48 | :toctree: generated/ 49 | 50 | align_adata_vars 51 | normalize_default 52 | quick_preprocess 53 | quick_pre_vis 54 | group_mean 55 | group_mean_adata 56 | wrapper_scale 57 | make_bipartite_adj 58 | take_1v1_matches 59 | subset_matches 60 | get_homologies 61 | take_adata_groups 62 | remove_adata_groups 63 | merge_adata_groups 64 | split_adata 65 | 66 | 67 | DataPair and AlignedDataPair 68 | ---------------------------- 69 | .. module:: came 70 | .. py:currentmodule:: came 71 | 72 | .. autosummary:: 73 | :toctree: generated/ 74 | 75 | make_features 76 | aligned_datapair_from_adatas 77 | datapair_from_adatas 78 | AlignedDataPair 79 | DataPair 80 | 81 | Graph Neural Network Model 82 | -------------------------- 83 | .. autosummary:: 84 | :toctree: generated/ 85 | 86 | CGGCNet 87 | CGCNet 88 | 89 | 90 | I/O Functions 91 | ------------- 92 | .. autosummary:: 93 | :toctree: generated/ 94 | 95 | load_dpair_and_model 96 | load_hidden_states 97 | save_hidden_states 98 | save_pickle 99 | load_pickle 100 | 101 | Analysis ``came.ana.*`` 102 | ----------------------- 103 | .. module:: came.utils.analyze 104 | .. :currentmodule:: came 105 | 106 | .. autosummary:: 107 | :toctree: generated/ 108 | 109 | weight_linked_vars 110 | weight_linked_vars_by_expr 111 | make_abstracted_graph 112 | compare_modules 113 | compute_common_private 114 | 115 | 116 | Plotting Functions ``came.pl.*`` 117 | -------------------------------- 118 | 119 | .. module:: came.utils.plot 120 | .. :currentmodule:: came 121 | 122 | .. autosummary:: 123 | :toctree: generated/ 124 | 125 | plot_stacked_bar 126 | heatmap_probas 127 | wrapper_heatmap_scores 128 | plot_confus_mat 129 | plot_contingency_mat 130 | embed_with_values 131 | adata_embed_with_values 132 | umap_with_annotates 133 | plot_multipartite_graph 134 | -------------------------------------------------------------------------------- /docs/_sources/citation.rst.txt: -------------------------------------------------------------------------------- 1 | Citation 2 | ======== 3 | 4 | If CAME is useful for your research, consider citing our paper: 5 | 6 | Liu X, Shen Q, Zhang S. Cross-species cell-type assignment of single-cell RNA-seq by a heterogeneous graph neural network[J]. Genome Research, 2022: gr. 276868.122. 7 | 8 | Preprint: https://doi.org/10.1101/2021.09.25.461790 9 | 10 | -------------------------------------------------------------------------------- /docs/_sources/faqs.rst.txt: -------------------------------------------------------------------------------- 1 | FAQs 2 | ==== 3 | 4 | About the input format 5 | ---------------------- 6 | 7 | **Q**: I processed my data using Seurat, and transformed them into .h5ad files. 8 | But an error occurred when I passed them into CAME's default pipeline. 9 | 10 | **A**: The problem is caused by "the h5ad files converted from seurat-object by 11 | ``SeuratDisk``". 12 | CAME process the data from the raw-count matrices. 13 | So please use scanpy to construct the AnnData object from the raw-count matrices 14 | (e.g., read from the ``*.mtx`` and ``*.txt`` files by ``scanpy.read()``) 15 | 16 | You can also use the following R code to export the filtered scRNA-seq data 17 | into an ``.h5`` file, which takes less time and space. 18 | 19 | .. code-block:: R 20 | 21 | # R code 22 | library(rhdf5) 23 | library(Matrix) 24 | 25 | save_h5mat = function(mat, fp_h5, feature_type, genome=""){ 26 | # save sparse.mat ('dgCMatrix' format) into a h5 file 27 | # ======= Test code ====== 28 | # tmp = Seurat::Read10X_h5(fp_h5) 29 | # all(tmp@x == mat@x) 30 | # all(tmp@i == mat@i) 31 | # all(tmp@p == mat@p) 32 | 33 | message(fp_h5) 34 | 35 | h5createFile(fp_h5) 36 | root = "matrix" 37 | h5createGroup(fp_h5, root) 38 | 39 | h5write(dim(mat), fp_h5, paste(root, "shape", sep='/')) 40 | h5write(mat@x, fp_h5, paste(root, "data", sep='/')) 41 | h5write(mat@i, fp_h5, paste(root, "indices", sep='/')) # mat@i - 1 ? 42 | h5write(mat@p, fp_h5, paste(root, "indptr", sep='/')) 43 | h5write(colnames(mat), fp_h5, paste(root, "barcodes", sep='/')) 44 | 45 | 46 | feat_root = paste(root, "features", sep='/') 47 | h5createGroup(fp_h5, feat_root) 48 | 49 | h5write(rownames(mat), fp_h5, paste(feat_root, "id", sep='/')) 50 | h5write(rownames(mat), fp_h5, paste(feat_root, "name", sep='/')) 51 | 52 | h5write(rep(feature_type, dim(mat)[1]), 53 | fp_h5, paste(feat_root, "feature_type", sep='/')) 54 | 55 | h5write(rep("", dim(mat)[1]), 56 | fp_h5, paste(feat_root, "derivation", sep='/')) 57 | h5write(rep(genome, dim(mat)[1]), # "mm10" 58 | fp_h5, paste(feat_root, "genome", sep='/')) 59 | h5write(c("genome", "derivation"), 60 | fp_h5, paste(feat_root, "_all_tag_keys", sep='/')) 61 | 62 | h5closeAll() 63 | message("Done!") 64 | } 65 | 66 | # save_h5mat_peak = function(mat, fp_h5, genome=""){ 67 | # save_h5mat(mat, fp_h5, feature_type = "Peaks", genome = genome) 68 | # } 69 | 70 | save_h5mat_gex = function(mat, fp_h5, genome=""){ 71 | save_h5mat(mat, fp_h5, feature_type = "Gene Expression", genome = genome) 72 | } 73 | # save the raw-counts in a Seurat-object "seurat_obj" 74 | mat = seurat_obj[["RNA"]]@counts 75 | save_h5mat_gex(mat, "matrix.raw.h5", genome="") 76 | 77 | # save the meta-data into a csv file: 78 | meta_data = seurat_obj@meta.data 79 | write.csv(meta_data, "metadata.csv") 80 | 81 | 82 | And read the h5 file using Scanpy's build-in function: 83 | 84 | .. code-block:: Python 85 | 86 | # python-code 87 | import pandas as pd 88 | import scanpy as sc 89 | 90 | fp_mat = 'matrix.raw.h5' 91 | fp_meta = 'metadata.csv' 92 | adata_raw = sc.read_10x_h5(fp_mat) 93 | metadata = pd.read_csv(fp_meta, index_col=0) 94 | # add meta-data 95 | for c in metadata.columns: 96 | adata_raw.obs[c] = metadata[c] 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /docs/_sources/generated/came.AlignedDataPair.rst.txt: -------------------------------------------------------------------------------- 1 | came.AlignedDataPair 2 | ==================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: AlignedDataPair 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~AlignedDataPair.__init__ 17 | ~AlignedDataPair.get_feature_dict 18 | ~AlignedDataPair.get_obs_anno 19 | ~AlignedDataPair.get_obs_dataset 20 | ~AlignedDataPair.get_obs_features 21 | ~AlignedDataPair.get_obs_ids 22 | ~AlignedDataPair.get_obs_labels 23 | ~AlignedDataPair.get_whole_net 24 | ~AlignedDataPair.load 25 | ~AlignedDataPair.make_ov_adj 26 | ~AlignedDataPair.make_whole_net 27 | ~AlignedDataPair.save_init 28 | ~AlignedDataPair.set_common_obs_annos 29 | ~AlignedDataPair.set_dataset_names 30 | ~AlignedDataPair.set_etypes 31 | ~AlignedDataPair.set_features 32 | ~AlignedDataPair.set_ntypes 33 | ~AlignedDataPair.set_obs_dfs 34 | ~AlignedDataPair.set_oo_adj 35 | ~AlignedDataPair.set_ov_adj 36 | ~AlignedDataPair.set_varnames_node 37 | ~AlignedDataPair.summary_graph 38 | 39 | 40 | 41 | 42 | 43 | .. rubric:: Attributes 44 | 45 | .. autosummary:: 46 | 47 | ~AlignedDataPair.G 48 | ~AlignedDataPair.classes 49 | ~AlignedDataPair.etypes 50 | ~AlignedDataPair.labels 51 | ~AlignedDataPair.n_feats 52 | ~AlignedDataPair.n_obs 53 | ~AlignedDataPair.n_obs1 54 | ~AlignedDataPair.n_obs2 55 | ~AlignedDataPair.n_vnodes 56 | ~AlignedDataPair.ntypes 57 | ~AlignedDataPair.obs_ids 58 | ~AlignedDataPair.obs_ids1 59 | ~AlignedDataPair.obs_ids2 60 | ~AlignedDataPair.oo_adj 61 | ~AlignedDataPair.ov_adj 62 | ~AlignedDataPair.varnames_feat 63 | ~AlignedDataPair.varnames_node 64 | ~AlignedDataPair.vnode_ids 65 | 66 | -------------------------------------------------------------------------------- /docs/_sources/generated/came.CGCNet.rst.txt: -------------------------------------------------------------------------------- 1 | came.CGCNet 2 | =========== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: CGCNet 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~CGCNet.__init__ 17 | ~CGCNet.add_module 18 | ~CGCNet.apply 19 | ~CGCNet.bfloat16 20 | ~CGCNet.buffers 21 | ~CGCNet.children 22 | ~CGCNet.cpu 23 | ~CGCNet.cuda 24 | ~CGCNet.double 25 | ~CGCNet.eval 26 | ~CGCNet.extra_repr 27 | ~CGCNet.float 28 | ~CGCNet.forward 29 | ~CGCNet.get_attentions 30 | ~CGCNet.get_buffer 31 | ~CGCNet.get_classification_loss 32 | ~CGCNet.get_extra_state 33 | ~CGCNet.get_hidden_states 34 | ~CGCNet.get_out_logits 35 | ~CGCNet.get_parameter 36 | ~CGCNet.get_sampler 37 | ~CGCNet.get_submodule 38 | ~CGCNet.half 39 | ~CGCNet.ipu 40 | ~CGCNet.load_state_dict 41 | ~CGCNet.modules 42 | ~CGCNet.named_buffers 43 | ~CGCNet.named_children 44 | ~CGCNet.named_modules 45 | ~CGCNet.named_parameters 46 | ~CGCNet.parameters 47 | ~CGCNet.register_backward_hook 48 | ~CGCNet.register_buffer 49 | ~CGCNet.register_forward_hook 50 | ~CGCNet.register_forward_pre_hook 51 | ~CGCNet.register_full_backward_hook 52 | ~CGCNet.register_load_state_dict_post_hook 53 | ~CGCNet.register_module 54 | ~CGCNet.register_parameter 55 | ~CGCNet.requires_grad_ 56 | ~CGCNet.set_extra_state 57 | ~CGCNet.share_memory 58 | ~CGCNet.state_dict 59 | ~CGCNet.to 60 | ~CGCNet.to_empty 61 | ~CGCNet.train 62 | ~CGCNet.type 63 | ~CGCNet.xpu 64 | ~CGCNet.zero_grad 65 | 66 | 67 | 68 | 69 | 70 | .. rubric:: Attributes 71 | 72 | .. autosummary:: 73 | 74 | ~CGCNet.T_destination 75 | ~CGCNet.dump_patches 76 | ~CGCNet.training 77 | 78 | -------------------------------------------------------------------------------- /docs/_sources/generated/came.CGGCNet.rst.txt: -------------------------------------------------------------------------------- 1 | came.CGGCNet 2 | ============ 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: CGGCNet 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~CGGCNet.__init__ 17 | ~CGGCNet.add_module 18 | ~CGGCNet.apply 19 | ~CGGCNet.bfloat16 20 | ~CGGCNet.buffers 21 | ~CGGCNet.children 22 | ~CGGCNet.cpu 23 | ~CGGCNet.cuda 24 | ~CGGCNet.double 25 | ~CGGCNet.eval 26 | ~CGGCNet.extra_repr 27 | ~CGGCNet.float 28 | ~CGGCNet.forward 29 | ~CGGCNet.get_attentions 30 | ~CGGCNet.get_buffer 31 | ~CGGCNet.get_classification_loss 32 | ~CGGCNet.get_extra_state 33 | ~CGGCNet.get_hidden_states 34 | ~CGGCNet.get_out_logits 35 | ~CGGCNet.get_parameter 36 | ~CGGCNet.get_sampler 37 | ~CGGCNet.get_submodule 38 | ~CGGCNet.half 39 | ~CGGCNet.ipu 40 | ~CGGCNet.load_state_dict 41 | ~CGGCNet.modules 42 | ~CGGCNet.named_buffers 43 | ~CGGCNet.named_children 44 | ~CGGCNet.named_modules 45 | ~CGGCNet.named_parameters 46 | ~CGGCNet.parameters 47 | ~CGGCNet.register_backward_hook 48 | ~CGGCNet.register_buffer 49 | ~CGGCNet.register_forward_hook 50 | ~CGGCNet.register_forward_pre_hook 51 | ~CGGCNet.register_full_backward_hook 52 | ~CGGCNet.register_load_state_dict_post_hook 53 | ~CGGCNet.register_module 54 | ~CGGCNet.register_parameter 55 | ~CGGCNet.requires_grad_ 56 | ~CGGCNet.set_extra_state 57 | ~CGGCNet.share_memory 58 | ~CGGCNet.state_dict 59 | ~CGGCNet.to 60 | ~CGGCNet.to_empty 61 | ~CGGCNet.train 62 | ~CGGCNet.type 63 | ~CGGCNet.xpu 64 | ~CGGCNet.zero_grad 65 | 66 | 67 | 68 | 69 | 70 | .. rubric:: Attributes 71 | 72 | .. autosummary:: 73 | 74 | ~CGGCNet.T_destination 75 | ~CGGCNet.dump_patches 76 | ~CGGCNet.training 77 | 78 | -------------------------------------------------------------------------------- /docs/_sources/generated/came.DataPair.rst.txt: -------------------------------------------------------------------------------- 1 | came.DataPair 2 | ============= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: DataPair 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~DataPair.__init__ 17 | ~DataPair.get_feature_dict 18 | ~DataPair.get_obs_anno 19 | ~DataPair.get_obs_dataset 20 | ~DataPair.get_obs_features 21 | ~DataPair.get_obs_ids 22 | ~DataPair.get_obs_labels 23 | ~DataPair.get_vnode_ids 24 | ~DataPair.get_vnode_ids_by_name 25 | ~DataPair.get_vnode_names 26 | ~DataPair.get_whole_net 27 | ~DataPair.load 28 | ~DataPair.make_ov_adj 29 | ~DataPair.make_whole_net 30 | ~DataPair.save_init 31 | ~DataPair.set_common_obs_annos 32 | ~DataPair.set_dataset_names 33 | ~DataPair.set_etypes 34 | ~DataPair.set_features 35 | ~DataPair.set_ntypes 36 | ~DataPair.set_obs_dfs 37 | ~DataPair.set_oo_adj 38 | ~DataPair.set_ov_adj 39 | ~DataPair.set_var_dfs 40 | ~DataPair.set_vnode_annos 41 | ~DataPair.set_vv_adj 42 | ~DataPair.summary_graph 43 | 44 | 45 | 46 | 47 | 48 | .. rubric:: Attributes 49 | 50 | .. autosummary:: 51 | 52 | ~DataPair.G 53 | ~DataPair.classes 54 | ~DataPair.etypes 55 | ~DataPair.feat_names1 56 | ~DataPair.feat_names2 57 | ~DataPair.labels 58 | ~DataPair.n_feats 59 | ~DataPair.n_obs 60 | ~DataPair.n_obs1 61 | ~DataPair.n_obs2 62 | ~DataPair.n_vnodes 63 | ~DataPair.n_vnodes1 64 | ~DataPair.n_vnodes2 65 | ~DataPair.ntypes 66 | ~DataPair.obs_ids 67 | ~DataPair.obs_ids1 68 | ~DataPair.obs_ids2 69 | ~DataPair.oo_adj 70 | ~DataPair.ov_adj 71 | ~DataPair.var_ids1 72 | ~DataPair.var_ids2 73 | ~DataPair.vnode_names1 74 | ~DataPair.vnode_names2 75 | ~DataPair.vv_adj 76 | 77 | -------------------------------------------------------------------------------- /docs/_sources/generated/came.aligned_datapair_from_adatas.rst.txt: -------------------------------------------------------------------------------- 1 | came.aligned\_datapair\_from\_adatas 2 | ==================================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: aligned_datapair_from_adatas -------------------------------------------------------------------------------- /docs/_sources/generated/came.datapair_from_adatas.rst.txt: -------------------------------------------------------------------------------- 1 | came.datapair\_from\_adatas 2 | =========================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: datapair_from_adatas -------------------------------------------------------------------------------- /docs/_sources/generated/came.load_dpair_and_model.rst.txt: -------------------------------------------------------------------------------- 1 | came.load\_dpair\_and\_model 2 | ============================ 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_dpair_and_model -------------------------------------------------------------------------------- /docs/_sources/generated/came.load_example_data.rst.txt: -------------------------------------------------------------------------------- 1 | came.load\_example\_data 2 | ======================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_example_data -------------------------------------------------------------------------------- /docs/_sources/generated/came.load_hidden_states.rst.txt: -------------------------------------------------------------------------------- 1 | came.load\_hidden\_states 2 | ========================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_hidden_states -------------------------------------------------------------------------------- /docs/_sources/generated/came.load_pickle.rst.txt: -------------------------------------------------------------------------------- 1 | came.load\_pickle 2 | ================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_pickle -------------------------------------------------------------------------------- /docs/_sources/generated/came.make_features.rst.txt: -------------------------------------------------------------------------------- 1 | came.make\_features 2 | =================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: make_features -------------------------------------------------------------------------------- /docs/_sources/generated/came.pipeline.gather_came_results.rst.txt: -------------------------------------------------------------------------------- 1 | came.pipeline.gather\_came\_results 2 | =================================== 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: gather_came_results -------------------------------------------------------------------------------- /docs/_sources/generated/came.pipeline.main_for_aligned.rst.txt: -------------------------------------------------------------------------------- 1 | came.pipeline.main\_for\_aligned 2 | ================================ 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: main_for_aligned -------------------------------------------------------------------------------- /docs/_sources/generated/came.pipeline.main_for_unaligned.rst.txt: -------------------------------------------------------------------------------- 1 | came.pipeline.main\_for\_unaligned 2 | ================================== 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: main_for_unaligned -------------------------------------------------------------------------------- /docs/_sources/generated/came.pipeline.preprocess_aligned.rst.txt: -------------------------------------------------------------------------------- 1 | came.pipeline.preprocess\_aligned 2 | ================================= 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: preprocess_aligned -------------------------------------------------------------------------------- /docs/_sources/generated/came.pipeline.preprocess_unaligned.rst.txt: -------------------------------------------------------------------------------- 1 | came.pipeline.preprocess\_unaligned 2 | =================================== 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: preprocess_unaligned -------------------------------------------------------------------------------- /docs/_sources/generated/came.save_hidden_states.rst.txt: -------------------------------------------------------------------------------- 1 | came.save\_hidden\_states 2 | ========================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: save_hidden_states -------------------------------------------------------------------------------- /docs/_sources/generated/came.save_pickle.rst.txt: -------------------------------------------------------------------------------- 1 | came.save\_pickle 2 | ================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: save_pickle -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.analyze.compare_modules.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.analyze.compare\_modules 2 | =================================== 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: compare_modules -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.analyze.compute_common_private.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.analyze.compute\_common\_private 2 | =========================================== 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: compute_common_private -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.analyze.make_abstracted_graph.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.analyze.make\_abstracted\_graph 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: make_abstracted_graph -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.analyze.weight_linked_vars.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.analyze.weight\_linked\_vars 2 | ======================================= 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: weight_linked_vars -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.analyze.weight_linked_vars_by_expr.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.analyze.weight\_linked\_vars\_by\_expr 2 | ================================================= 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: weight_linked_vars_by_expr -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.adata_embed_with_values.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.adata\_embed\_with\_values 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: adata_embed_with_values -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.embed_with_values.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.embed\_with\_values 2 | =================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: embed_with_values -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.heatmap_probas.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.heatmap\_probas 2 | =============================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: heatmap_probas -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.plot_confus_mat.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_confus\_mat 2 | ================================= 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_confus_mat -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.plot_contingency_mat.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_contingency\_mat 2 | ====================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_contingency_mat -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.plot_multipartite_graph.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_multipartite\_graph 2 | ========================================= 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_multipartite_graph -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.plot_stacked_bar.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_stacked\_bar 2 | ================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_stacked_bar -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.umap_with_annotates.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.umap\_with\_annotates 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: umap_with_annotates -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.plot.wrapper_heatmap_scores.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.plot.wrapper\_heatmap\_scores 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: wrapper_heatmap_scores -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.align_adata_vars.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.align\_adata\_vars 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: align_adata_vars -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.get_homologies.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.get\_homologies 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: get_homologies -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.group_mean.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.group\_mean 2 | ================================= 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: group_mean -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.group_mean_adata.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.group\_mean\_adata 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: group_mean_adata -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.make_bipartite_adj.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.make\_bipartite\_adj 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: make_bipartite_adj -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.merge_adata_groups.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.merge\_adata\_groups 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: merge_adata_groups -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.normalize_default.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.normalize\_default 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: normalize_default -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.quick_pre_vis.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.quick\_pre\_vis 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: quick_pre_vis -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.quick_preprocess.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.quick\_preprocess 2 | ======================================= 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: quick_preprocess -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.remove_adata_groups.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.remove\_adata\_groups 2 | =========================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: remove_adata_groups -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.split_adata.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.split\_adata 2 | ================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: split_adata -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.subset_matches.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.subset\_matches 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: subset_matches -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.take_1v1_matches.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.take\_1v1\_matches 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: take_1v1_matches -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.take_adata_groups.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.take\_adata\_groups 2 | ========================================= 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: take_adata_groups -------------------------------------------------------------------------------- /docs/_sources/generated/came.utils.preprocess.wrapper_scale.rst.txt: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.wrapper\_scale 2 | ==================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: wrapper_scale -------------------------------------------------------------------------------- /docs/_sources/generated/came.weight_linked_vars.rst.txt: -------------------------------------------------------------------------------- 1 | came.weight\_linked\_vars 2 | ========================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: weight_linked_vars -------------------------------------------------------------------------------- /docs/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. CAME documentation master file, created by 2 | sphinx-quickstart on Sat Jul 24 10:14:53 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | CAME 7 | ==== 8 | 9 | CAME is a tool for Cell-type Assignment and Module Extraction, 10 | based on a heterogeneous graph neural network. 11 | 12 | To get started with CAME's pipeline, browse the tutorials below: 13 | * :doc:`tut_notebooks/getting_started_pipeline_un` 14 | * :doc:`tut_notebooks/getting_started_pipeline_aligned` 15 | 16 | 17 | .. image:: _static/Fig1ABC.png 18 | :width: 600px 19 | 20 | CAME outputs the quantitative cell-type assignment for each query cell, that is, 21 | the probabilities of cell types that exist in the reference species, which 22 | enables the identification of the unresolved cell states in the query data. 23 | 24 | Besides, CAME gives the aligned cell and gene embeddings across species, which 25 | facilitates low-dimensional visualization and joint gene module extraction. 26 | 27 | 28 | .. image:: _static/Fig1D.png 29 | :width: 600px 30 | 31 | .. toctree:: 32 | :caption: Contents 33 | :maxdepth: 1 34 | 35 | installation 36 | tutorials 37 | api 38 | faqs 39 | citation 40 | 41 | 42 | Citation 43 | -------- 44 | 45 | If CAME is useful for your research, consider citing our paper: 46 | 47 | Liu X, Shen Q, Zhang S. Cross-species cell-type assignment of single-cell RNA-seq by a heterogeneous graph neural network[J]. Genome Research, 2022: gr. 276868.122. 48 | 49 | 50 | 51 | 52 | Contribute 53 | ---------- 54 | 55 | - Issue Tracker: https://github.com/XingyanLiu/CAME/issues 56 | - Source Code: https://github.com/XingyanLiu/CAME 57 | 58 | Support 59 | ------- 60 | 61 | If you are having issues, please let us know. 62 | We have a mailing list located at: 63 | 64 | * xingyan@amss.ac.cn 65 | * 544568643@qq.com 66 | 67 | 68 | Indices and tables 69 | ================== 70 | 71 | * :ref:`genindex` 72 | * :ref:`search` 73 | -------------------------------------------------------------------------------- /docs/_sources/installation.rst.txt: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | It's recommended to create a conda environment for running CAME: 5 | 6 | .. code-block:: shell 7 | 8 | conda create -n env_came python=3.8 9 | conda activate env_came 10 | 11 | 12 | Install required packages: 13 | 14 | .. code-block:: shell 15 | 16 | pip install "scanpy[leiden]" 17 | pip install torch # >=1.8 18 | pip install dgl 19 | 20 | See scanpy (https://scanpy.readthedocs.io/en/stable/), 21 | PyTorch (https://pytorch.org/) and DGL(https://www.dgl.ai/) 22 | for detailed installation guide (especially for GPU version). 23 | 24 | Install CAME 25 | ~~~~~~~~~~~~ 26 | 27 | To install CAME with PyPI, run: 28 | 29 | .. code-block:: shell 30 | 31 | pip install came 32 | 33 | 34 | Or fetch from GitHub and manually install: 35 | 36 | .. code-block:: shell 37 | 38 | git clone https://github.com/zhanglabtools/CAME.git 39 | cd CAME 40 | python setup.py install 41 | 42 | -------------------------------------------------------------------------------- /docs/_sources/tutorials.rst.txt: -------------------------------------------------------------------------------- 1 | Tutorials 2 | ========= 3 | 4 | The example data 5 | ---------------- 6 | 7 | The tutorials are based on the example data attached to the CAME package. 8 | It is initially saved in compressed form (`CAME/came/sample_data.zip`), 9 | and will be automatically decompressed to the default directory 10 | (`CAME/came/sample_data/`) when necessary, which contains the following files: 11 | 12 | - gene_matches_1v1_human2mouse.csv (optional) 13 | - gene_matches_1v1_mouse2human.csv (optional) 14 | - gene_matches_human2mouse.csv 15 | - gene_matches_mouse2human.csv 16 | - raw-Baron_mouse.h5ad 17 | - raw-Baron_human.h5ad 18 | 19 | You can access these data by :doc:`generated/came.load_example_data`. 20 | 21 | If you tend to apply CAME to analyze your own datasets, you need to 22 | prepare at least the last two files for the same species (e.g., cross-dataset 23 | integration); 24 | 25 | For cross-species analysis, you need to provide another `.csv` 26 | file where the first column contains the genes in the reference species and the 27 | second contains the corresponding query homologous genes. 28 | 29 | **NOTE** 30 | 31 | The file `raw-Baron_human.h5ad` is a subsample from the original data 32 | for code testing. The resulting annotation accuracy may not be as good as 33 | using the full dataset as the reference. 34 | 35 | 36 | Getting started 37 | --------------- 38 | 39 | .. toctree:: 40 | :maxdepth: 1 41 | 42 | tut_notebooks/getting_started_pipeline_un 43 | tut_notebooks/getting_started_pipeline_aligned 44 | tut_notebooks/load_results 45 | -------------------------------------------------------------------------------- /docs/_static/Fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/Fig1.png -------------------------------------------------------------------------------- /docs/_static/Fig1ABC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/Fig1ABC.png -------------------------------------------------------------------------------- /docs/_static/Fig1D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/Fig1D.png -------------------------------------------------------------------------------- /docs/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Base JavaScript utilities for all Sphinx HTML documentation. 6 | * 7 | * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | "use strict"; 12 | 13 | const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ 14 | "TEXTAREA", 15 | "INPUT", 16 | "SELECT", 17 | "BUTTON", 18 | ]); 19 | 20 | const _ready = (callback) => { 21 | if (document.readyState !== "loading") { 22 | callback(); 23 | } else { 24 | document.addEventListener("DOMContentLoaded", callback); 25 | } 26 | }; 27 | 28 | /** 29 | * Small JavaScript module for the documentation. 30 | */ 31 | const Documentation = { 32 | init: () => { 33 | Documentation.initDomainIndexTable(); 34 | Documentation.initOnKeyListeners(); 35 | }, 36 | 37 | /** 38 | * i18n support 39 | */ 40 | TRANSLATIONS: {}, 41 | PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), 42 | LOCALE: "unknown", 43 | 44 | // gettext and ngettext don't access this so that the functions 45 | // can safely bound to a different name (_ = Documentation.gettext) 46 | gettext: (string) => { 47 | const translated = Documentation.TRANSLATIONS[string]; 48 | switch (typeof translated) { 49 | case "undefined": 50 | return string; // no translation 51 | case "string": 52 | return translated; // translation exists 53 | default: 54 | return translated[0]; // (singular, plural) translation tuple exists 55 | } 56 | }, 57 | 58 | ngettext: (singular, plural, n) => { 59 | const translated = Documentation.TRANSLATIONS[singular]; 60 | if (typeof translated !== "undefined") 61 | return translated[Documentation.PLURAL_EXPR(n)]; 62 | return n === 1 ? singular : plural; 63 | }, 64 | 65 | addTranslations: (catalog) => { 66 | Object.assign(Documentation.TRANSLATIONS, catalog.messages); 67 | Documentation.PLURAL_EXPR = new Function( 68 | "n", 69 | `return (${catalog.plural_expr})` 70 | ); 71 | Documentation.LOCALE = catalog.locale; 72 | }, 73 | 74 | /** 75 | * helper function to focus on search bar 76 | */ 77 | focusSearchBar: () => { 78 | document.querySelectorAll("input[name=q]")[0]?.focus(); 79 | }, 80 | 81 | /** 82 | * Initialise the domain index toggle buttons 83 | */ 84 | initDomainIndexTable: () => { 85 | const toggler = (el) => { 86 | const idNumber = el.id.substr(7); 87 | const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); 88 | if (el.src.substr(-9) === "minus.png") { 89 | el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; 90 | toggledRows.forEach((el) => (el.style.display = "none")); 91 | } else { 92 | el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; 93 | toggledRows.forEach((el) => (el.style.display = "")); 94 | } 95 | }; 96 | 97 | const togglerElements = document.querySelectorAll("img.toggler"); 98 | togglerElements.forEach((el) => 99 | el.addEventListener("click", (event) => toggler(event.currentTarget)) 100 | ); 101 | togglerElements.forEach((el) => (el.style.display = "")); 102 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); 103 | }, 104 | 105 | initOnKeyListeners: () => { 106 | // only install a listener if it is really needed 107 | if ( 108 | !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && 109 | !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS 110 | ) 111 | return; 112 | 113 | document.addEventListener("keydown", (event) => { 114 | // bail for input elements 115 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; 116 | // bail with special keys 117 | if (event.altKey || event.ctrlKey || event.metaKey) return; 118 | 119 | if (!event.shiftKey) { 120 | switch (event.key) { 121 | case "ArrowLeft": 122 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; 123 | 124 | const prevLink = document.querySelector('link[rel="prev"]'); 125 | if (prevLink && prevLink.href) { 126 | window.location.href = prevLink.href; 127 | event.preventDefault(); 128 | } 129 | break; 130 | case "ArrowRight": 131 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; 132 | 133 | const nextLink = document.querySelector('link[rel="next"]'); 134 | if (nextLink && nextLink.href) { 135 | window.location.href = nextLink.href; 136 | event.preventDefault(); 137 | } 138 | break; 139 | } 140 | } 141 | 142 | // some keyboard layouts may need Shift to get / 143 | switch (event.key) { 144 | case "/": 145 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; 146 | Documentation.focusSearchBar(); 147 | event.preventDefault(); 148 | } 149 | }); 150 | }, 151 | }; 152 | 153 | // quick alias for translations 154 | const _ = Documentation.gettext; 155 | 156 | _ready(Documentation.init); 157 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '', 4 | LANGUAGE: 'en', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false, 12 | SHOW_SEARCH_SUMMARY: true, 13 | ENABLE_SEARCH_SHORTCUTS: true, 14 | }; -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/_static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /docs/_static/js/html5shiv-printshiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/_static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | !function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}t.length>0&&($(".wy-menu-vertical .current").removeClass("current"),t.addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l1").parent().addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l2").addClass("current"),t.closest("li.toctree-l3").addClass("current"),t.closest("li.toctree-l4").addClass("current"),t.closest("li.toctree-l5").addClass("current"),t[0].scrollIntoView())}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t=1.8 18 | pip install dgl 19 | 20 | See scanpy (https://scanpy.readthedocs.io/en/stable/), 21 | PyTorch (https://pytorch.org/) and DGL(https://www.dgl.ai/) 22 | for detailed installation guide (especially for GPU version). 23 | 24 | Install CAME 25 | ~~~~~~~~~~~~ 26 | 27 | To install CAME with PyPI, run: 28 | 29 | .. code-block:: shell 30 | 31 | pip install came 32 | 33 | 34 | Or fetch from GitHub and manually install: 35 | 36 | .. code-block:: shell 37 | 38 | git clone https://github.com/zhanglabtools/CAME.git 39 | cd CAME 40 | python setup.py install 41 | 42 | -------------------------------------------------------------------------------- /docs/build/html/_sources/tutorials.rst.txt: -------------------------------------------------------------------------------- 1 | Tutorials 2 | ========= 3 | 4 | The example data 5 | ---------------- 6 | 7 | The tutorials are based on the example data attached to the CAME package. 8 | It is initially saved in compressed form (`CAME/came/sample_data.zip`), 9 | and will be automatically decompressed to the default directory 10 | (`CAME/came/sample_data/`) when necessary, which contains the following files: 11 | 12 | - gene_matches_1v1_human2mouse.csv (optional) 13 | - gene_matches_1v1_mouse2human.csv (optional) 14 | - gene_matches_human2mouse.csv 15 | - gene_matches_mouse2human.csv 16 | - raw-Baron_mouse.h5ad 17 | - raw-Baron_human.h5ad 18 | 19 | You can access these data by :doc:`generated/came.load_example_data`. 20 | 21 | If you tend to apply CAME to analyze your own datasets, you need to 22 | prepare at least the last two files for the same species (e.g., cross-dataset 23 | integration); 24 | 25 | For cross-species analysis, you need to provide another `.csv` 26 | file where the first column contains the genes in the reference species and the 27 | second contains the corresponding query homologous genes. 28 | 29 | **NOTE** 30 | 31 | The file `raw-Baron_human.h5ad` is a subsample from the original data 32 | for code testing. The resulting annotation accuracy may not be as good as 33 | using the full dataset as the reference. 34 | 35 | 36 | Getting started 37 | --------------- 38 | 39 | .. toctree:: 40 | :maxdepth: 1 41 | 42 | tut_notebooks/getting_started_pipeline_un 43 | tut_notebooks/getting_started_pipeline_aligned 44 | tut_notebooks/load_results 45 | -------------------------------------------------------------------------------- /docs/build/html/_static/Fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/Fig1.png -------------------------------------------------------------------------------- /docs/build/html/_static/Fig1ABC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/Fig1ABC.png -------------------------------------------------------------------------------- /docs/build/html/_static/Fig1D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/Fig1D.png -------------------------------------------------------------------------------- /docs/build/html/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/build/html/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '', 4 | LANGUAGE: 'en', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false, 12 | SHOW_SEARCH_SUMMARY: true, 13 | ENABLE_SEARCH_SHORTCUTS: true, 14 | }; -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /docs/build/html/_static/js/html5shiv-printshiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/build/html/_static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/build/html/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | !function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}t.length>0&&($(".wy-menu-vertical .current").removeClass("current"),t.addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l1").parent().addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l2").addClass("current"),t.closest("li.toctree-l3").addClass("current"),t.closest("li.toctree-l4").addClass("current"),t.closest("li.toctree-l5").addClass("current"),t[0].scrollIntoView())}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;tNUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/objects.inv -------------------------------------------------------------------------------- /docs/pipe.sh: -------------------------------------------------------------------------------- 1 | # cd docs 2 | if [ "$1" == "autogen" ] 3 | then 4 | PYTHONPATH=../ sphinx-autogen source/*.rst 5 | else 6 | make clean 7 | make html 8 | cp -r build/html/* . 9 | fi 10 | -------------------------------------------------------------------------------- /docs/source/_static/Fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/source/_static/Fig1.png -------------------------------------------------------------------------------- /docs/source/_static/Fig1ABC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/source/_static/Fig1ABC.png -------------------------------------------------------------------------------- /docs/source/_static/Fig1D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanglabtools/CAME/ac7218a396805b53ec93958226c9ab91a0786c7f/docs/source/_static/Fig1D.png -------------------------------------------------------------------------------- /docs/source/api.rst: -------------------------------------------------------------------------------- 1 | .. module:: came 2 | .. automodule:: came 3 | :noindex: 4 | 5 | API References 6 | ============== 7 | 8 | 9 | Import CAME: 10 | 11 | .. code:: ipython3 12 | 13 | import came 14 | 15 | Example data 16 | ------------ 17 | 18 | .. module:: came 19 | 20 | .. autosummary:: 21 | :toctree: generated/ 22 | 23 | load_example_data 24 | 25 | 26 | Pipeline ``came.pipeline.*`` 27 | ---------------------------- 28 | 29 | .. module:: came.pipeline 30 | .. :currentmodule:: came 31 | 32 | .. autosummary:: 33 | :toctree: generated/ 34 | 35 | main_for_aligned 36 | main_for_unaligned 37 | preprocess_aligned 38 | preprocess_unaligned 39 | gather_came_results 40 | 41 | Preprocessing ``came.pp.*`` 42 | --------------------------- 43 | 44 | .. module:: came.utils.preprocess 45 | .. :currentmodule:: came 46 | 47 | .. autosummary:: 48 | :toctree: generated/ 49 | 50 | align_adata_vars 51 | normalize_default 52 | quick_preprocess 53 | quick_pre_vis 54 | group_mean 55 | group_mean_adata 56 | wrapper_scale 57 | make_bipartite_adj 58 | take_1v1_matches 59 | subset_matches 60 | get_homologies 61 | take_adata_groups 62 | remove_adata_groups 63 | merge_adata_groups 64 | split_adata 65 | 66 | 67 | DataPair and AlignedDataPair 68 | ---------------------------- 69 | .. module:: came 70 | .. py:currentmodule:: came 71 | 72 | .. autosummary:: 73 | :toctree: generated/ 74 | 75 | make_features 76 | aligned_datapair_from_adatas 77 | datapair_from_adatas 78 | AlignedDataPair 79 | DataPair 80 | 81 | Graph Neural Network Model 82 | -------------------------- 83 | .. autosummary:: 84 | :toctree: generated/ 85 | 86 | CGGCNet 87 | CGCNet 88 | 89 | 90 | I/O Functions 91 | ------------- 92 | .. autosummary:: 93 | :toctree: generated/ 94 | 95 | load_dpair_and_model 96 | load_hidden_states 97 | save_hidden_states 98 | save_pickle 99 | load_pickle 100 | 101 | Analysis ``came.ana.*`` 102 | ----------------------- 103 | .. module:: came.utils.analyze 104 | .. :currentmodule:: came 105 | 106 | .. autosummary:: 107 | :toctree: generated/ 108 | 109 | weight_linked_vars 110 | weight_linked_vars_by_expr 111 | make_abstracted_graph 112 | compare_modules 113 | compute_common_private 114 | 115 | 116 | Plotting Functions ``came.pl.*`` 117 | -------------------------------- 118 | 119 | .. module:: came.utils.plot 120 | .. :currentmodule:: came 121 | 122 | .. autosummary:: 123 | :toctree: generated/ 124 | 125 | plot_stacked_bar 126 | heatmap_probas 127 | wrapper_heatmap_scores 128 | plot_confus_mat 129 | plot_contingency_mat 130 | embed_with_values 131 | adata_embed_with_values 132 | umap_with_annotates 133 | plot_multipartite_graph 134 | -------------------------------------------------------------------------------- /docs/source/citation.rst: -------------------------------------------------------------------------------- 1 | Citation 2 | ======== 3 | 4 | If CAME is useful for your research, consider citing our paper: 5 | 6 | Liu X, Shen Q, Zhang S. Cross-species cell-type assignment of single-cell RNA-seq by a heterogeneous graph neural network[J]. Genome Research, 2022: gr. 276868.122. 7 | 8 | Preprint: https://doi.org/10.1101/2021.09.25.461790 9 | 10 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | import os 14 | import sys 15 | from datetime import datetime 16 | sys.path.insert(0, os.path.abspath('.')) 17 | sys.path.insert(0, os.path.abspath(f'{os.path.dirname(__file__)}/../..')) 18 | 19 | 20 | # -- Project information ----------------------------------------------------- 21 | 22 | project = 'CAME' 23 | author = 'Xingyan Liu' 24 | _copyright = 'Academy of Mathematics and Systems Science, CAS' 25 | copyright = f'{datetime.now():%Y}, {_copyright}.' 26 | 27 | 28 | # -- General configuration --------------------------------------------------- 29 | pygments_style = 'sphinx' # coloring code blocks 30 | 31 | # Add any Sphinx extension module names here, as strings. They can be 32 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 33 | # ones. 34 | extensions = [ 35 | 'sphinx.ext.autodoc', 36 | 'sphinx.ext.autosummary', 37 | 'sphinx.ext.napoleon', # different doc-styles (Google, Numpy) 38 | # 'myst_parser', # use Markdown using MyST 39 | "nbsphinx", # notebooks 40 | 'sphinx.ext.doctest', 41 | 'sphinx.ext.intersphinx', 42 | 'sphinx.ext.todo', 43 | 'sphinx.ext.coverage', 44 | 'sphinx.ext.mathjax', 45 | 'sphinx.ext.githubpages', # enable github-pages 46 | # 'sphinx_autodoc_typehints', # needs to be after napoleon 47 | ] 48 | autosummary_generate = True 49 | autodoc_member_order = 'bysource' 50 | napoleon_include_init_with_doc = False 51 | napoleon_use_rtype = True # having a separate entry generally helps readability 52 | napoleon_use_param = True 53 | todo_include_todos = False 54 | 55 | # Add any paths that contain templates here, relative to this directory. 56 | templates_path = ['_templates'] 57 | 58 | # List of patterns, relative to source directory, that match files and 59 | # directories to ignore when looking for source files. 60 | # This pattern also affects html_static_path and html_extra_path. 61 | exclude_patterns = [ 62 | '*PARAMETERS.py' 63 | ] 64 | 65 | 66 | # -- Options for HTML output ------------------------------------------------- 67 | 68 | # The theme to use for HTML and HTML Help pages. See the documentation for 69 | # a list of builtin themes. 70 | # 71 | # html_theme = 'alabaster' 72 | html_theme = 'sphinx_rtd_theme' 73 | 74 | # Add any paths that contain custom static files (such as style sheets) here, 75 | # relative to this directory. They are copied after the builtin static files, 76 | # so a file named "default.css" will overwrite the builtin "default.css". 77 | html_static_path = ['_static'] 78 | 79 | # source_suffix = '.rst' 80 | from recommonmark.parser import CommonMarkParser 81 | source_parsers = { 82 | '.md': CommonMarkParser, 83 | } 84 | source_suffix = ['.rst', '.md'] 85 | -------------------------------------------------------------------------------- /docs/source/faqs.rst: -------------------------------------------------------------------------------- 1 | FAQs 2 | ==== 3 | 4 | About the input format 5 | ---------------------- 6 | 7 | **Q**: I processed my data using Seurat, and transformed them into .h5ad files. 8 | But an error occurred when I passed them into CAME's default pipeline. 9 | 10 | **A**: The problem is caused by "the h5ad files converted from seurat-object by 11 | ``SeuratDisk``". 12 | CAME process the data from the raw-count matrices. 13 | So please use scanpy to construct the AnnData object from the raw-count matrices 14 | (e.g., read from the ``*.mtx`` and ``*.txt`` files by ``scanpy.read()``) 15 | 16 | You can also use the following R code to export the filtered scRNA-seq data 17 | into an ``.h5`` file, which takes less time and space. 18 | 19 | .. code-block:: R 20 | 21 | # R code 22 | library(rhdf5) 23 | library(Matrix) 24 | 25 | save_h5mat = function(mat, fp_h5, feature_type, genome=""){ 26 | # save sparse.mat ('dgCMatrix' format) into a h5 file 27 | # ======= Test code ====== 28 | # tmp = Seurat::Read10X_h5(fp_h5) 29 | # all(tmp@x == mat@x) 30 | # all(tmp@i == mat@i) 31 | # all(tmp@p == mat@p) 32 | 33 | message(fp_h5) 34 | 35 | h5createFile(fp_h5) 36 | root = "matrix" 37 | h5createGroup(fp_h5, root) 38 | 39 | h5write(dim(mat), fp_h5, paste(root, "shape", sep='/')) 40 | h5write(mat@x, fp_h5, paste(root, "data", sep='/')) 41 | h5write(mat@i, fp_h5, paste(root, "indices", sep='/')) # mat@i - 1 ? 42 | h5write(mat@p, fp_h5, paste(root, "indptr", sep='/')) 43 | h5write(colnames(mat), fp_h5, paste(root, "barcodes", sep='/')) 44 | 45 | 46 | feat_root = paste(root, "features", sep='/') 47 | h5createGroup(fp_h5, feat_root) 48 | 49 | h5write(rownames(mat), fp_h5, paste(feat_root, "id", sep='/')) 50 | h5write(rownames(mat), fp_h5, paste(feat_root, "name", sep='/')) 51 | 52 | h5write(rep(feature_type, dim(mat)[1]), 53 | fp_h5, paste(feat_root, "feature_type", sep='/')) 54 | 55 | h5write(rep("", dim(mat)[1]), 56 | fp_h5, paste(feat_root, "derivation", sep='/')) 57 | h5write(rep(genome, dim(mat)[1]), # "mm10" 58 | fp_h5, paste(feat_root, "genome", sep='/')) 59 | h5write(c("genome", "derivation"), 60 | fp_h5, paste(feat_root, "_all_tag_keys", sep='/')) 61 | 62 | h5closeAll() 63 | message("Done!") 64 | } 65 | 66 | # save_h5mat_peak = function(mat, fp_h5, genome=""){ 67 | # save_h5mat(mat, fp_h5, feature_type = "Peaks", genome = genome) 68 | # } 69 | 70 | save_h5mat_gex = function(mat, fp_h5, genome=""){ 71 | save_h5mat(mat, fp_h5, feature_type = "Gene Expression", genome = genome) 72 | } 73 | # save the raw-counts in a Seurat-object "seurat_obj" 74 | mat = seurat_obj[["RNA"]]@counts 75 | save_h5mat_gex(mat, "matrix.raw.h5", genome="") 76 | 77 | # save the meta-data into a csv file: 78 | meta_data = seurat_obj@meta.data 79 | write.csv(meta_data, "metadata.csv") 80 | 81 | 82 | And read the h5 file using Scanpy's build-in function: 83 | 84 | .. code-block:: Python 85 | 86 | # python-code 87 | import pandas as pd 88 | import scanpy as sc 89 | 90 | fp_mat = 'matrix.raw.h5' 91 | fp_meta = 'metadata.csv' 92 | adata_raw = sc.read_10x_h5(fp_mat) 93 | metadata = pd.read_csv(fp_meta, index_col=0) 94 | # add meta-data 95 | for c in metadata.columns: 96 | adata_raw.obs[c] = metadata[c] 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /docs/source/generated/came.AlignedDataPair.rst: -------------------------------------------------------------------------------- 1 | came.AlignedDataPair 2 | ==================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: AlignedDataPair 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~AlignedDataPair.__init__ 17 | ~AlignedDataPair.get_feature_dict 18 | ~AlignedDataPair.get_obs_anno 19 | ~AlignedDataPair.get_obs_dataset 20 | ~AlignedDataPair.get_obs_features 21 | ~AlignedDataPair.get_obs_ids 22 | ~AlignedDataPair.get_obs_labels 23 | ~AlignedDataPair.get_whole_net 24 | ~AlignedDataPair.load 25 | ~AlignedDataPair.make_ov_adj 26 | ~AlignedDataPair.make_whole_net 27 | ~AlignedDataPair.save_init 28 | ~AlignedDataPair.set_common_obs_annos 29 | ~AlignedDataPair.set_dataset_names 30 | ~AlignedDataPair.set_etypes 31 | ~AlignedDataPair.set_features 32 | ~AlignedDataPair.set_ntypes 33 | ~AlignedDataPair.set_obs_dfs 34 | ~AlignedDataPair.set_oo_adj 35 | ~AlignedDataPair.set_ov_adj 36 | ~AlignedDataPair.set_varnames_node 37 | ~AlignedDataPair.summary_graph 38 | 39 | 40 | 41 | 42 | 43 | .. rubric:: Attributes 44 | 45 | .. autosummary:: 46 | 47 | ~AlignedDataPair.G 48 | ~AlignedDataPair.classes 49 | ~AlignedDataPair.etypes 50 | ~AlignedDataPair.labels 51 | ~AlignedDataPair.n_feats 52 | ~AlignedDataPair.n_obs 53 | ~AlignedDataPair.n_obs1 54 | ~AlignedDataPair.n_obs2 55 | ~AlignedDataPair.n_vnodes 56 | ~AlignedDataPair.ntypes 57 | ~AlignedDataPair.obs_ids 58 | ~AlignedDataPair.obs_ids1 59 | ~AlignedDataPair.obs_ids2 60 | ~AlignedDataPair.oo_adj 61 | ~AlignedDataPair.ov_adj 62 | ~AlignedDataPair.varnames_feat 63 | ~AlignedDataPair.varnames_node 64 | ~AlignedDataPair.vnode_ids 65 | 66 | -------------------------------------------------------------------------------- /docs/source/generated/came.CGCNet.rst: -------------------------------------------------------------------------------- 1 | came.CGCNet 2 | =========== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: CGCNet 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~CGCNet.__init__ 17 | ~CGCNet.add_module 18 | ~CGCNet.apply 19 | ~CGCNet.bfloat16 20 | ~CGCNet.buffers 21 | ~CGCNet.children 22 | ~CGCNet.cpu 23 | ~CGCNet.cuda 24 | ~CGCNet.double 25 | ~CGCNet.eval 26 | ~CGCNet.extra_repr 27 | ~CGCNet.float 28 | ~CGCNet.forward 29 | ~CGCNet.get_attentions 30 | ~CGCNet.get_buffer 31 | ~CGCNet.get_classification_loss 32 | ~CGCNet.get_extra_state 33 | ~CGCNet.get_hidden_states 34 | ~CGCNet.get_out_logits 35 | ~CGCNet.get_parameter 36 | ~CGCNet.get_sampler 37 | ~CGCNet.get_submodule 38 | ~CGCNet.half 39 | ~CGCNet.ipu 40 | ~CGCNet.load_state_dict 41 | ~CGCNet.modules 42 | ~CGCNet.named_buffers 43 | ~CGCNet.named_children 44 | ~CGCNet.named_modules 45 | ~CGCNet.named_parameters 46 | ~CGCNet.parameters 47 | ~CGCNet.register_backward_hook 48 | ~CGCNet.register_buffer 49 | ~CGCNet.register_forward_hook 50 | ~CGCNet.register_forward_pre_hook 51 | ~CGCNet.register_full_backward_hook 52 | ~CGCNet.register_load_state_dict_post_hook 53 | ~CGCNet.register_module 54 | ~CGCNet.register_parameter 55 | ~CGCNet.requires_grad_ 56 | ~CGCNet.set_extra_state 57 | ~CGCNet.share_memory 58 | ~CGCNet.state_dict 59 | ~CGCNet.to 60 | ~CGCNet.to_empty 61 | ~CGCNet.train 62 | ~CGCNet.type 63 | ~CGCNet.xpu 64 | ~CGCNet.zero_grad 65 | 66 | 67 | 68 | 69 | 70 | .. rubric:: Attributes 71 | 72 | .. autosummary:: 73 | 74 | ~CGCNet.T_destination 75 | ~CGCNet.dump_patches 76 | ~CGCNet.training 77 | 78 | -------------------------------------------------------------------------------- /docs/source/generated/came.CGGCNet.rst: -------------------------------------------------------------------------------- 1 | came.CGGCNet 2 | ============ 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: CGGCNet 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~CGGCNet.__init__ 17 | ~CGGCNet.add_module 18 | ~CGGCNet.apply 19 | ~CGGCNet.bfloat16 20 | ~CGGCNet.buffers 21 | ~CGGCNet.children 22 | ~CGGCNet.cpu 23 | ~CGGCNet.cuda 24 | ~CGGCNet.double 25 | ~CGGCNet.eval 26 | ~CGGCNet.extra_repr 27 | ~CGGCNet.float 28 | ~CGGCNet.forward 29 | ~CGGCNet.get_attentions 30 | ~CGGCNet.get_buffer 31 | ~CGGCNet.get_classification_loss 32 | ~CGGCNet.get_extra_state 33 | ~CGGCNet.get_hidden_states 34 | ~CGGCNet.get_out_logits 35 | ~CGGCNet.get_parameter 36 | ~CGGCNet.get_sampler 37 | ~CGGCNet.get_submodule 38 | ~CGGCNet.half 39 | ~CGGCNet.ipu 40 | ~CGGCNet.load_state_dict 41 | ~CGGCNet.modules 42 | ~CGGCNet.named_buffers 43 | ~CGGCNet.named_children 44 | ~CGGCNet.named_modules 45 | ~CGGCNet.named_parameters 46 | ~CGGCNet.parameters 47 | ~CGGCNet.register_backward_hook 48 | ~CGGCNet.register_buffer 49 | ~CGGCNet.register_forward_hook 50 | ~CGGCNet.register_forward_pre_hook 51 | ~CGGCNet.register_full_backward_hook 52 | ~CGGCNet.register_load_state_dict_post_hook 53 | ~CGGCNet.register_module 54 | ~CGGCNet.register_parameter 55 | ~CGGCNet.requires_grad_ 56 | ~CGGCNet.set_extra_state 57 | ~CGGCNet.share_memory 58 | ~CGGCNet.state_dict 59 | ~CGGCNet.to 60 | ~CGGCNet.to_empty 61 | ~CGGCNet.train 62 | ~CGGCNet.type 63 | ~CGGCNet.xpu 64 | ~CGGCNet.zero_grad 65 | 66 | 67 | 68 | 69 | 70 | .. rubric:: Attributes 71 | 72 | .. autosummary:: 73 | 74 | ~CGGCNet.T_destination 75 | ~CGGCNet.dump_patches 76 | ~CGGCNet.training 77 | 78 | -------------------------------------------------------------------------------- /docs/source/generated/came.DataPair.rst: -------------------------------------------------------------------------------- 1 | came.DataPair 2 | ============= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autoclass:: DataPair 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~DataPair.__init__ 17 | ~DataPair.get_feature_dict 18 | ~DataPair.get_obs_anno 19 | ~DataPair.get_obs_dataset 20 | ~DataPair.get_obs_features 21 | ~DataPair.get_obs_ids 22 | ~DataPair.get_obs_labels 23 | ~DataPair.get_vnode_ids 24 | ~DataPair.get_vnode_ids_by_name 25 | ~DataPair.get_vnode_names 26 | ~DataPair.get_whole_net 27 | ~DataPair.load 28 | ~DataPair.make_ov_adj 29 | ~DataPair.make_whole_net 30 | ~DataPair.save_init 31 | ~DataPair.set_common_obs_annos 32 | ~DataPair.set_dataset_names 33 | ~DataPair.set_etypes 34 | ~DataPair.set_features 35 | ~DataPair.set_ntypes 36 | ~DataPair.set_obs_dfs 37 | ~DataPair.set_oo_adj 38 | ~DataPair.set_ov_adj 39 | ~DataPair.set_var_dfs 40 | ~DataPair.set_vnode_annos 41 | ~DataPair.set_vv_adj 42 | ~DataPair.summary_graph 43 | 44 | 45 | 46 | 47 | 48 | .. rubric:: Attributes 49 | 50 | .. autosummary:: 51 | 52 | ~DataPair.G 53 | ~DataPair.classes 54 | ~DataPair.etypes 55 | ~DataPair.feat_names1 56 | ~DataPair.feat_names2 57 | ~DataPair.labels 58 | ~DataPair.n_feats 59 | ~DataPair.n_obs 60 | ~DataPair.n_obs1 61 | ~DataPair.n_obs2 62 | ~DataPair.n_vnodes 63 | ~DataPair.n_vnodes1 64 | ~DataPair.n_vnodes2 65 | ~DataPair.ntypes 66 | ~DataPair.obs_ids 67 | ~DataPair.obs_ids1 68 | ~DataPair.obs_ids2 69 | ~DataPair.oo_adj 70 | ~DataPair.ov_adj 71 | ~DataPair.var_ids1 72 | ~DataPair.var_ids2 73 | ~DataPair.vnode_names1 74 | ~DataPair.vnode_names2 75 | ~DataPair.vv_adj 76 | 77 | -------------------------------------------------------------------------------- /docs/source/generated/came.aligned_datapair_from_adatas.rst: -------------------------------------------------------------------------------- 1 | came.aligned\_datapair\_from\_adatas 2 | ==================================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: aligned_datapair_from_adatas -------------------------------------------------------------------------------- /docs/source/generated/came.datapair_from_adatas.rst: -------------------------------------------------------------------------------- 1 | came.datapair\_from\_adatas 2 | =========================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: datapair_from_adatas -------------------------------------------------------------------------------- /docs/source/generated/came.load_dpair_and_model.rst: -------------------------------------------------------------------------------- 1 | came.load\_dpair\_and\_model 2 | ============================ 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_dpair_and_model -------------------------------------------------------------------------------- /docs/source/generated/came.load_example_data.rst: -------------------------------------------------------------------------------- 1 | came.load\_example\_data 2 | ======================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_example_data -------------------------------------------------------------------------------- /docs/source/generated/came.load_hidden_states.rst: -------------------------------------------------------------------------------- 1 | came.load\_hidden\_states 2 | ========================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_hidden_states -------------------------------------------------------------------------------- /docs/source/generated/came.load_pickle.rst: -------------------------------------------------------------------------------- 1 | came.load\_pickle 2 | ================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: load_pickle -------------------------------------------------------------------------------- /docs/source/generated/came.make_features.rst: -------------------------------------------------------------------------------- 1 | came.make\_features 2 | =================== 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: make_features -------------------------------------------------------------------------------- /docs/source/generated/came.pipeline.gather_came_results.rst: -------------------------------------------------------------------------------- 1 | came.pipeline.gather\_came\_results 2 | =================================== 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: gather_came_results -------------------------------------------------------------------------------- /docs/source/generated/came.pipeline.main_for_aligned.rst: -------------------------------------------------------------------------------- 1 | came.pipeline.main\_for\_aligned 2 | ================================ 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: main_for_aligned -------------------------------------------------------------------------------- /docs/source/generated/came.pipeline.main_for_unaligned.rst: -------------------------------------------------------------------------------- 1 | came.pipeline.main\_for\_unaligned 2 | ================================== 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: main_for_unaligned -------------------------------------------------------------------------------- /docs/source/generated/came.pipeline.preprocess_aligned.rst: -------------------------------------------------------------------------------- 1 | came.pipeline.preprocess\_aligned 2 | ================================= 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: preprocess_aligned -------------------------------------------------------------------------------- /docs/source/generated/came.pipeline.preprocess_unaligned.rst: -------------------------------------------------------------------------------- 1 | came.pipeline.preprocess\_unaligned 2 | =================================== 3 | 4 | .. currentmodule:: came.pipeline 5 | 6 | .. autofunction:: preprocess_unaligned -------------------------------------------------------------------------------- /docs/source/generated/came.save_hidden_states.rst: -------------------------------------------------------------------------------- 1 | came.save\_hidden\_states 2 | ========================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: save_hidden_states -------------------------------------------------------------------------------- /docs/source/generated/came.save_pickle.rst: -------------------------------------------------------------------------------- 1 | came.save\_pickle 2 | ================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: save_pickle -------------------------------------------------------------------------------- /docs/source/generated/came.utils.analyze.compare_modules.rst: -------------------------------------------------------------------------------- 1 | came.utils.analyze.compare\_modules 2 | =================================== 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: compare_modules -------------------------------------------------------------------------------- /docs/source/generated/came.utils.analyze.compute_common_private.rst: -------------------------------------------------------------------------------- 1 | came.utils.analyze.compute\_common\_private 2 | =========================================== 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: compute_common_private -------------------------------------------------------------------------------- /docs/source/generated/came.utils.analyze.make_abstracted_graph.rst: -------------------------------------------------------------------------------- 1 | came.utils.analyze.make\_abstracted\_graph 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: make_abstracted_graph -------------------------------------------------------------------------------- /docs/source/generated/came.utils.analyze.weight_linked_vars.rst: -------------------------------------------------------------------------------- 1 | came.utils.analyze.weight\_linked\_vars 2 | ======================================= 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: weight_linked_vars -------------------------------------------------------------------------------- /docs/source/generated/came.utils.analyze.weight_linked_vars_by_expr.rst: -------------------------------------------------------------------------------- 1 | came.utils.analyze.weight\_linked\_vars\_by\_expr 2 | ================================================= 3 | 4 | .. currentmodule:: came.utils.analyze 5 | 6 | .. autofunction:: weight_linked_vars_by_expr -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.adata_embed_with_values.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.adata\_embed\_with\_values 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: adata_embed_with_values -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.embed_with_values.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.embed\_with\_values 2 | =================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: embed_with_values -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.heatmap_probas.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.heatmap\_probas 2 | =============================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: heatmap_probas -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.plot_confus_mat.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_confus\_mat 2 | ================================= 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_confus_mat -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.plot_contingency_mat.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_contingency\_mat 2 | ====================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_contingency_mat -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.plot_multipartite_graph.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_multipartite\_graph 2 | ========================================= 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_multipartite_graph -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.plot_stacked_bar.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.plot\_stacked\_bar 2 | ================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: plot_stacked_bar -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.umap_with_annotates.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.umap\_with\_annotates 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: umap_with_annotates -------------------------------------------------------------------------------- /docs/source/generated/came.utils.plot.wrapper_heatmap_scores.rst: -------------------------------------------------------------------------------- 1 | came.utils.plot.wrapper\_heatmap\_scores 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.plot 5 | 6 | .. autofunction:: wrapper_heatmap_scores -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.align_adata_vars.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.align\_adata\_vars 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: align_adata_vars -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.get_homologies.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.get\_homologies 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: get_homologies -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.group_mean.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.group\_mean 2 | ================================= 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: group_mean -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.group_mean_adata.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.group\_mean\_adata 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: group_mean_adata -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.make_bipartite_adj.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.make\_bipartite\_adj 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: make_bipartite_adj -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.merge_adata_groups.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.merge\_adata\_groups 2 | ========================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: merge_adata_groups -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.normalize_default.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.normalize\_default 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: normalize_default -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.quick_pre_vis.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.quick\_pre\_vis 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: quick_pre_vis -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.quick_preprocess.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.quick\_preprocess 2 | ======================================= 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: quick_preprocess -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.remove_adata_groups.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.remove\_adata\_groups 2 | =========================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: remove_adata_groups -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.split_adata.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.split\_adata 2 | ================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: split_adata -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.subset_matches.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.subset\_matches 2 | ===================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: subset_matches -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.take_1v1_matches.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.take\_1v1\_matches 2 | ======================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: take_1v1_matches -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.take_adata_groups.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.take\_adata\_groups 2 | ========================================= 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: take_adata_groups -------------------------------------------------------------------------------- /docs/source/generated/came.utils.preprocess.wrapper_scale.rst: -------------------------------------------------------------------------------- 1 | came.utils.preprocess.wrapper\_scale 2 | ==================================== 3 | 4 | .. currentmodule:: came.utils.preprocess 5 | 6 | .. autofunction:: wrapper_scale -------------------------------------------------------------------------------- /docs/source/generated/came.weight_linked_vars.rst: -------------------------------------------------------------------------------- 1 | came.weight\_linked\_vars 2 | ========================= 3 | 4 | .. currentmodule:: came 5 | 6 | .. autofunction:: weight_linked_vars -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. CAME documentation master file, created by 2 | sphinx-quickstart on Sat Jul 24 10:14:53 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | CAME 7 | ==== 8 | 9 | CAME is a tool for Cell-type Assignment and Module Extraction, 10 | based on a heterogeneous graph neural network. 11 | 12 | To get started with CAME's pipeline, browse the tutorials below: 13 | * :doc:`tut_notebooks/getting_started_pipeline_un` 14 | * :doc:`tut_notebooks/getting_started_pipeline_aligned` 15 | 16 | 17 | .. image:: _static/Fig1ABC.png 18 | :width: 600px 19 | 20 | CAME outputs the quantitative cell-type assignment for each query cell, that is, 21 | the probabilities of cell types that exist in the reference species, which 22 | enables the identification of the unresolved cell states in the query data. 23 | 24 | Besides, CAME gives the aligned cell and gene embeddings across species, which 25 | facilitates low-dimensional visualization and joint gene module extraction. 26 | 27 | 28 | .. image:: _static/Fig1D.png 29 | :width: 600px 30 | 31 | .. toctree:: 32 | :caption: Contents 33 | :maxdepth: 1 34 | 35 | installation 36 | tutorials 37 | api 38 | faqs 39 | citation 40 | 41 | 42 | Citation 43 | -------- 44 | 45 | If CAME is useful for your research, consider citing our paper: 46 | 47 | Liu X, Shen Q, Zhang S. Cross-species cell-type assignment of single-cell RNA-seq by a heterogeneous graph neural network[J]. Genome Research, 2022: gr. 276868.122. 48 | 49 | 50 | 51 | 52 | Contribute 53 | ---------- 54 | 55 | - Issue Tracker: https://github.com/XingyanLiu/CAME/issues 56 | - Source Code: https://github.com/XingyanLiu/CAME 57 | 58 | Support 59 | ------- 60 | 61 | If you are having issues, please let us know. 62 | We have a mailing list located at: 63 | 64 | * xingyan@amss.ac.cn 65 | * 544568643@qq.com 66 | 67 | 68 | Indices and tables 69 | ================== 70 | 71 | * :ref:`genindex` 72 | * :ref:`search` 73 | -------------------------------------------------------------------------------- /docs/source/installation.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | It's recommended to create a conda environment for running CAME: 5 | 6 | .. code-block:: shell 7 | 8 | conda create -n env_came python=3.8 9 | conda activate env_came 10 | 11 | 12 | Install required packages: 13 | 14 | .. code-block:: shell 15 | 16 | pip install "scanpy[leiden]" 17 | pip install torch # >=1.8 18 | pip install dgl # better below 1.0.* 19 | 20 | See scanpy (https://scanpy.readthedocs.io/en/stable/), 21 | PyTorch (https://pytorch.org/) and DGL(https://www.dgl.ai/) 22 | for detailed installation guide (especially for GPU version). 23 | 24 | Install CAME 25 | ~~~~~~~~~~~~ 26 | 27 | To install CAME with PyPI, run: 28 | 29 | .. code-block:: shell 30 | 31 | pip install came 32 | 33 | 34 | Or fetch from GitHub and manually install: 35 | 36 | .. code-block:: shell 37 | 38 | git clone https://github.com/zhanglabtools/CAME.git 39 | cd CAME 40 | python setup.py install 41 | 42 | -------------------------------------------------------------------------------- /docs/source/tutorials.rst: -------------------------------------------------------------------------------- 1 | Tutorials 2 | ========= 3 | 4 | The example data 5 | ---------------- 6 | 7 | The tutorials are based on the example data attached to the CAME package. 8 | It is initially saved in compressed form (`CAME/came/sample_data.zip`), 9 | and will be automatically decompressed to the default directory 10 | (`CAME/came/sample_data/`) when necessary, which contains the following files: 11 | 12 | - gene_matches_1v1_human2mouse.csv (optional) 13 | - gene_matches_1v1_mouse2human.csv (optional) 14 | - gene_matches_human2mouse.csv 15 | - gene_matches_mouse2human.csv 16 | - raw-Baron_mouse.h5ad 17 | - raw-Baron_human.h5ad 18 | 19 | You can access these data by :doc:`generated/came.load_example_data`. 20 | 21 | If you tend to apply CAME to analyze your own datasets, you need to 22 | prepare at least the last two files for the same species (e.g., cross-dataset 23 | integration); 24 | 25 | For cross-species analysis, you need to provide another `.csv` 26 | file where the first column contains the genes in the reference species and the 27 | second contains the corresponding query homologous genes. 28 | 29 | **NOTE** 30 | 31 | The file `raw-Baron_human.h5ad` is a subsample from the original data 32 | for code testing. The resulting annotation accuracy may not be as good as 33 | using the full dataset as the reference. 34 | 35 | 36 | Getting started 37 | --------------- 38 | 39 | .. toctree:: 40 | :maxdepth: 1 41 | 42 | tut_notebooks/getting_started_pipeline_un 43 | tut_notebooks/getting_started_pipeline_aligned 44 | tut_notebooks/load_results 45 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=42", 4 | "wheel" 5 | ] 6 | build-backend = "setuptools.build_meta" 7 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | "scanpy[leiden]" 2 | torch>=1.8 3 | dgl 4 | 5 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | # @Author: Xingyan Liu 3 | # @File: setup.py 4 | # @Project: CAME 5 | 6 | # Note: To use the 'upload' functionality of this file, you must: 7 | # $ pipenv install twine --dev 8 | 9 | import io 10 | import os 11 | import sys 12 | from shutil import rmtree 13 | 14 | from setuptools import find_packages, setup, Command 15 | 16 | # Package meta-data. 17 | NAME = 'came' 18 | DESCRIPTION = 'cell-type assignment and gene module extraction of scRNA-seq' 19 | URL = 'https://github.com/XingyanLiu/CAME' 20 | EMAIL = '544568643@qq.com' 21 | AUTHOR = 'Xingyan Liu' 22 | REQUIRES_PYTHON = '>=3.8.0' 23 | VERSION = '0.1.12' 24 | 25 | REQUIRED = [ 26 | 'scanpy', 27 | 'torch', 28 | 'dgl' 29 | ] 30 | 31 | # What packages are optional? 32 | EXTRAS = { 33 | # 'fancy feature': ['django'], 34 | } 35 | 36 | 37 | here = os.path.abspath(os.path.dirname(__file__)) 38 | PKG_DIR = os.path.join(here, "came") 39 | 40 | # Import the README and use it as the long-description. 41 | # Note: this will only work if 'README.md' is present in your MANIFEST.in file! 42 | try: 43 | with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: 44 | long_description = '\n' + f.read() 45 | except FileNotFoundError: 46 | long_description = DESCRIPTION 47 | 48 | # Load the package's __version__.py module as a dictionary. 49 | about = {} 50 | if not VERSION: 51 | project_slug = NAME.lower().replace("-", "_").replace(" ", "_") 52 | with open(os.path.join(here, project_slug, '__version__.py')) as f: 53 | exec(f.read(), about) 54 | else: 55 | about['__version__'] = VERSION 56 | 57 | 58 | class UploadCommand(Command): 59 | """Support setup.py upload.""" 60 | 61 | description = 'Build and publish the package.' 62 | user_options = [] 63 | 64 | @staticmethod 65 | def status(s): 66 | """Prints things in bold.""" 67 | print('\033[1m{0}\033[0m'.format(s)) 68 | 69 | def initialize_options(self): 70 | pass 71 | 72 | def finalize_options(self): 73 | pass 74 | 75 | def run(self): 76 | try: 77 | self.status('Removing previous builds…') 78 | rmtree(os.path.join(here, 'dist')) 79 | except OSError: 80 | pass 81 | 82 | self.status('Building Source and Wheel (universal) distribution…') 83 | os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable)) 84 | 85 | self.status('Uploading the package to PyPI via Twine…') 86 | os.system('twine upload dist/*') 87 | 88 | self.status('Pushing git tags…') 89 | os.system('git tag v{0}'.format(about['__version__'])) 90 | os.system('git push --tags') 91 | 92 | sys.exit() 93 | 94 | 95 | # Where the magic happens: 96 | setup( 97 | name=NAME, 98 | version=about['__version__'], 99 | description=DESCRIPTION, 100 | long_description=long_description, 101 | long_description_content_type='text/markdown', 102 | author=AUTHOR, 103 | author_email=EMAIL, 104 | python_requires=REQUIRES_PYTHON, 105 | url=URL, 106 | packages=find_packages( 107 | exclude=["tests", "*.tests", "*.tests.*", "tests.*", "*.csv", "*.h5ad"], 108 | ), 109 | package_data={"": [os.path.join(PKG_DIR, "sample_data.zip")]}, # additional package data 110 | install_requires=REQUIRED, 111 | extras_require=EXTRAS, 112 | include_package_data=True, 113 | license='MIT', 114 | classifiers=[ 115 | # Trove classifiers 116 | # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers 117 | 'License :: OSI Approved :: MIT License', 118 | 'Programming Language :: Python', 119 | 'Programming Language :: Python :: 3', 120 | 'Programming Language :: Python :: 3.8', 121 | 'Programming Language :: Python :: Implementation :: CPython', 122 | 'Programming Language :: Python :: Implementation :: PyPy' 123 | ], 124 | # $ setup.py publish support. 125 | cmdclass={ 126 | 'upload': UploadCommand, 127 | }, 128 | ) 129 | -------------------------------------------------------------------------------- /test_pipeline.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Wed May 5 20:08:52 2021 4 | 5 | @author: Xingyan Liu 6 | """ 7 | import came 8 | import logging 9 | 10 | 11 | try: 12 | import matplotlib as mpl 13 | mpl.use('agg') 14 | except Exception as e: 15 | print(f"An error occurred when setting matplotlib backend ({e})") 16 | 17 | if __name__ == '__main__': 18 | logging.basicConfig( 19 | level=logging.INFO, 20 | format='%(asctime)s %(filename)s-%(lineno)d-%(funcName)s(): ' 21 | '%(levelname)s\n %(message)s') 22 | 23 | came.__test1__(10, batch_size=None, reverse=False) 24 | came.__test2__(10, batch_size=2048) 25 | 26 | --------------------------------------------------------------------------------