scmito 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. scmito-0.2.0/.gitignore +43 -0
  2. scmito-0.2.0/CHANGELOG.md +127 -0
  3. scmito-0.2.0/LICENSE +21 -0
  4. scmito-0.2.0/PKG-INFO +178 -0
  5. scmito-0.2.0/README.md +99 -0
  6. scmito-0.2.0/pyproject.toml +141 -0
  7. scmito-0.2.0/src/mito/__init__.py +5 -0
  8. scmito-0.2.0/src/mito/assets/REDIdb_MT.txt.gz +0 -0
  9. scmito-0.2.0/src/mito/assets/__init__.py +0 -0
  10. scmito-0.2.0/src/mito/assets/chrM.fa +186 -0
  11. scmito-0.2.0/src/mito/assets/dbSNP_MT.txt +516 -0
  12. scmito-0.2.0/src/mito/assets/formatted_table_wobble.csv.gz +0 -0
  13. scmito-0.2.0/src/mito/assets/weng2024_mut_spectrum_ref.csv.gz +0 -0
  14. scmito-0.2.0/src/mito/io/__init__.py +4 -0
  15. scmito-0.2.0/src/mito/io/format_afm.py +902 -0
  16. scmito-0.2.0/src/mito/io/phylo_io.py +173 -0
  17. scmito-0.2.0/src/mito/pl/__init__.py +20 -0
  18. scmito-0.2.0/src/mito/pl/diagnostic_plots.py +268 -0
  19. scmito-0.2.0/src/mito/pl/embeddings_plots.py +119 -0
  20. scmito-0.2.0/src/mito/pl/heatmaps_plots.py +200 -0
  21. scmito-0.2.0/src/mito/pl/other_plots.py +87 -0
  22. scmito-0.2.0/src/mito/pl/phylo_plots.py +583 -0
  23. scmito-0.2.0/src/mito/pp/__init__.py +18 -0
  24. scmito-0.2.0/src/mito/pp/dimred.py +201 -0
  25. scmito-0.2.0/src/mito/pp/distances.py +507 -0
  26. scmito-0.2.0/src/mito/pp/filters.py +908 -0
  27. scmito-0.2.0/src/mito/pp/kNN.py +183 -0
  28. scmito-0.2.0/src/mito/pp/preprocessing.py +536 -0
  29. scmito-0.2.0/src/mito/tl/__init__.py +10 -0
  30. scmito-0.2.0/src/mito/tl/_classification.py +212 -0
  31. scmito-0.2.0/src/mito/tl/annotate.py +856 -0
  32. scmito-0.2.0/src/mito/tl/bootstrap.py +137 -0
  33. scmito-0.2.0/src/mito/tl/clustering.py +29 -0
  34. scmito-0.2.0/src/mito/tl/phenotype.py +306 -0
  35. scmito-0.2.0/src/mito/tl/phylo.py +250 -0
  36. scmito-0.2.0/src/mito/ut/__init__.py +65 -0
  37. scmito-0.2.0/src/mito/ut/de_utils.py +169 -0
  38. scmito-0.2.0/src/mito/ut/metrics.py +398 -0
  39. scmito-0.2.0/src/mito/ut/phylo_utils.py +76 -0
  40. scmito-0.2.0/src/mito/ut/positions.py +75 -0
  41. scmito-0.2.0/src/mito/ut/stats_utils.py +232 -0
  42. scmito-0.2.0/src/mito/ut/utils.py +483 -0
  43. scmito-0.2.0/tests/conftest.py +272 -0
  44. scmito-0.2.0/tests/test_api_smoke.py +251 -0
  45. scmito-0.2.0/tests/test_pl_plot_tree.py +368 -0
  46. scmito-0.2.0/tests/test_pp_filter_afm.py +631 -0
  47. scmito-0.2.0/tests/test_pp_filter_cells.py +204 -0
  48. scmito-0.2.0/tests/test_pp_genotyping.py +244 -0
  49. scmito-0.2.0/tests/test_pp_kNN_graph.py +87 -0
  50. scmito-0.2.0/tests/test_pp_reduce_dimensions.py +116 -0
  51. scmito-0.2.0/tests/test_tl_build_tree.py +88 -0
  52. scmito-0.2.0/tests/test_tl_tree_annotator.py +138 -0
@@ -0,0 +1,43 @@
1
+ # Temp files
2
+ */.DS_Store
3
+ *~
4
+ buck-out/
5
+
6
+ # Compiled files
7
+ .venv/
8
+ __pycache__/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+
12
+ # Distribution / packaging
13
+ /build/
14
+ /dist/
15
+ /*.egg-info/
16
+ **/*.egg-info/
17
+
18
+ # Tests and coverage
19
+ /.pytest_cache/
20
+ /.cache/
21
+ /data/
22
+ /node_modules/
23
+
24
+ # docs
25
+ /docs/generated/
26
+ /docs/_build/
27
+ /docs/build/
28
+
29
+ # IDEs
30
+ /.idea/
31
+ /.vscode/
32
+ .claude/
33
+
34
+ # Data files from tutorials
35
+ /docs/notebooks/*.fcs
36
+ /docs/notebooks/*.h5ad
37
+ /docs/source/data_test/
38
+ /docs/source/**/*.h5ad
39
+ /docs/source/**/*.fcs
40
+
41
+ */__pycache__
42
+ scratch/
43
+ docs/_preview/
@@ -0,0 +1,127 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.1.5] - 2026-02-03
6
+ - Nat Comm release
7
+
8
+ ## [0.1.4] - 2026-01-01
9
+ - Last bug fixes
10
+
11
+ ## [0.1.3] - 2026-01-29
12
+ ### Enhanced
13
+ - **kNN Graph Computations**: Improved k-nearest neighbor graph algorithms
14
+ - Optimized distance calculations for better performance in large datasets
15
+ - Enhanced graph construction methods for more accurate neighborhood detection
16
+ - Improved memory efficiency in graph building operations
17
+ - Better handling of edge cases in sparse data scenarios
18
+
19
+ ### Technical
20
+ - Refined algorithms for more robust graph-based analyses
21
+ - Enhanced computational efficiency for scalable graph operations
22
+
23
+ ## [0.1.2] - 2025-10-23
24
+ ### Enhanced
25
+ - **Performance Optimizations**: Major parallelization improvements using joblib
26
+ - Parallelized Moran's I computation in `filter_variant_moransI` with batch processing
27
+ - Parallelized mutation enrichment computation in `MiToTreeAnnotator.get_M` method
28
+ - Memory-efficient matrix caching to avoid redundant serialization across workers
29
+ - Configurable core usage and temporary folder management for large datasets
30
+
31
+ ### Added
32
+ - **Multi-allelic Site Filtering**: New quality control functionality
33
+ - Added `filter_multiallelic_sites` function to remove variants from sites with multiple alleles
34
+ - Integrated multi-allelic filtering in RedeeM data processing pipeline
35
+ - Ensures each genomic position has only one variant type for cleaner analyses
36
+ - **Dual Implementation Support**: Both serial and parallel versions available for performance testing
37
+ - **Enhanced RedeeM Support**: Improved data processing for RedeeM scLT system
38
+
39
+ ### Fixed
40
+ - Memory usage optimization in parallel processing by caching matrix variables
41
+ - Proper joblib backend configuration for stable parallel execution
42
+ - Improved progress tracking for long-running computations
43
+
44
+ ### Technical
45
+ - Migrated from multiprocessing to joblib for better memory management
46
+ - Added batch processing patterns for scalable parallel computation
47
+ - Enhanced error handling and progress reporting in parallel workflows
48
+
49
+ ## [0.1.1] - 2025-10-08
50
+ ### Enhanced
51
+ - Improved clonal inference algorithm with edge case handling for small phylogenies
52
+ - Added `af_treshold` parameter to `resolve_ambiguous_clones` for better clone merging control
53
+ - Split `infer_clones` and `resolve_ambiguous_clones` methods for better modularity
54
+ - Enhanced grid search optimization with better parameter handling
55
+ - Fixed root node exclusion in `_find_clones` to prevent single-clone edge cases
56
+
57
+ ### Fixed
58
+ - Resolved issue where very small phylogenies would only return root as single clone
59
+ - Improved silhouette score calculation for edge cases with minimal clones
60
+ - Better parameter validation and error handling in clonal inference pipeline
61
+
62
+ ### Refactored
63
+ - Cleaner separation between clone detection and clone resolution phases
64
+ - Improved code organization in `MiToTreeAnnotator` class
65
+ - Better debugging support with modular function structure
66
+
67
+ ## [0.1.0] - 2025-10-06
68
+ ### Added
69
+ - Complete documentation overhaul with nbsphinx integration
70
+ - Interactive Jupyter notebook tutorial with full cell outputs and visualizations
71
+ - Comprehensive getting started guide with MiTo workflow examples
72
+ - Hierarchical documentation structure for better navigation
73
+ - ReadTheDocs integration with automated builds
74
+
75
+ ### Improved
76
+ - Streamlined installation guide with clear step-by-step instructions
77
+ - Enhanced plotting library examples and demonstrations
78
+ - Better code organization and documentation structure
79
+ - Cleaner repository structure with proper .gitignore rules
80
+
81
+ ### Fixed
82
+ - nbsphinx configuration for proper notebook rendering
83
+ - Image generation and display in documentation
84
+ - Documentation build process for ReadTheDocs compatibility
85
+ - File size issues with test data exclusion
86
+
87
+ ## [0.0.8] - 2025-09-25
88
+ ### Fixed
89
+ - Add mt.io.make_afm behavior
90
+
91
+ ## [0.0.7] - 2025-09-25
92
+ ### Fixed
93
+ - Add chrM.fa to assets
94
+
95
+ ## [0.0.6] - 2025-09-17
96
+ ### Fixed
97
+ - Fixed asset path detection for conda environments
98
+ - Assets now properly accessible via sys.prefix location
99
+ - Improved _find_assets_path() function to check conda environment directory
100
+
101
+ ## [0.0.4] - 2025-09-12
102
+ ### Fixed
103
+ - Fixed asset files inclusion in package distribution (PyPI release)
104
+ - Improved asset path detection for both development and installed environments
105
+ - Assets (dbSNP_MT.txt, REDIdb_MT.txt, formatted_table_wobble.csv, weng2024_mut_spectrum_ref.csv) now properly included in pip installations
106
+
107
+ ## [0.0.3] - 2025-09-11
108
+ ### Added
109
+ - Code refactoring and improvements
110
+ - Enhanced functionality and bug fixes
111
+ - Updated documentation
112
+
113
+ ### Fixed
114
+ - Assets (dbSNP_MT.txt, REDIdb_MT.txt, formatted_table_wobble.csv, weng2024_mut_spectrum_ref.csv) now properly included in pip installations
115
+ - Smart asset path finder that works in both development and production environments
116
+
117
+ ## [0.0.2] - 2025-03-25
118
+ ### Added
119
+ - Updated docs.
120
+
121
+ ## [0.0.1] - 2025-03-24
122
+ ### Added
123
+ - Initial release of the mito package.
124
+ - Packaging via `setup.py` for PyPI distribution.
125
+ - Core functionality for mito analyses.
126
+ - First docs.
127
+
scmito-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 acox1
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.
scmito-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,178 @@
1
+ Metadata-Version: 2.4
2
+ Name: scmito
3
+ Version: 0.2.0
4
+ Summary: Mitochondrial lineage tracing and single-cell multi-omics in Python
5
+ Project-URL: Homepage, https://github.com/andrecossa5/MiTo
6
+ Project-URL: Documentation, https://scmito.readthedocs.io/en/latest/index.html
7
+ Project-URL: Repository, https://github.com/andrecossa5/MiTo
8
+ Project-URL: Issues, https://github.com/andrecossa5/MiTo/issues
9
+ Author-email: Andrea Cossa <andrea.cossa05@gmail.com>
10
+ License: MIT License
11
+
12
+ Copyright (c) 2023 acox1
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: lineage-tracing,mitochondrial-DNA,phylogenetics,scLT,single-cell
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: MacOS :: MacOS X
37
+ Classifier: Operating System :: POSIX :: Linux
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
43
+ Requires-Python: >=3.11
44
+ Requires-Dist: ac-plotting-ut>=0.2.1
45
+ Requires-Dist: anndata>=0.10
46
+ Requires-Dist: bbmix>=0.1
47
+ Requires-Dist: biopython>=1.80
48
+ Requires-Dist: cassiopeia-mt>=2.1.3
49
+ Requires-Dist: circlify>=0.15
50
+ Requires-Dist: gseapy>=1.1
51
+ Requires-Dist: igraph>=0.10
52
+ Requires-Dist: joblib>=1.3
53
+ Requires-Dist: leidenalg>=0.10
54
+ Requires-Dist: lightgbm>=4.0
55
+ Requires-Dist: matplotlib>=3.8
56
+ Requires-Dist: mquad>=0.1.8
57
+ Requires-Dist: networkx>=3.1
58
+ Requires-Dist: numpy>=1.26
59
+ Requires-Dist: pandas>=2.2
60
+ Requires-Dist: scanpy>=1.10
61
+ Requires-Dist: scikit-learn>=1.4
62
+ Requires-Dist: scipy>=1.11
63
+ Requires-Dist: seaborn>=0.13
64
+ Requires-Dist: shap>=0.44
65
+ Requires-Dist: statsmodels>=0.14
66
+ Requires-Dist: tqdm>=4.60
67
+ Requires-Dist: umap-learn>=0.5
68
+ Provides-Extra: docs
69
+ Requires-Dist: furo; extra == 'docs'
70
+ Requires-Dist: ipykernel; extra == 'docs'
71
+ Requires-Dist: nbsphinx; extra == 'docs'
72
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
73
+ Requires-Dist: sphinx-design; extra == 'docs'
74
+ Requires-Dist: sphinx>=7; extra == 'docs'
75
+ Provides-Extra: test
76
+ Requires-Dist: pytest-cov>=4.0; extra == 'test'
77
+ Requires-Dist: pytest>=7.0; extra == 'test'
78
+ Description-Content-Type: text/markdown
79
+
80
+ <div align="center">
81
+ <img src="image/MiTo_logo_transparent.png" alt="MiTo" width="260">
82
+ </div>
83
+
84
+ # MiTo (Mitochondrial single-cell lineage tracing Toolkit)
85
+
86
+ **Mitochondrial single-cell multi-omics in Python.**
87
+
88
+ [![PyPI](https://img.shields.io/pypi/v/scmito.svg)](https://pypi.org/project/scmito/)
89
+ [![Python](https://img.shields.io/pypi/pyversions/scmito.svg)](https://pypi.org/project/scmito/)
90
+ [![Tests](https://github.com/andrecossa5/MiTo/actions/workflows/test.yml/badge.svg)](https://github.com/andrecossa5/MiTo/actions/workflows/test.yml)
91
+ [![Documentation](https://readthedocs.org/projects/scmito/badge/?version=latest)](https://scmito.readthedocs.io/en/latest/index.html)
92
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
93
+
94
+ **MiTo** infer clonal ancestries in single-cell data from natural mtDNA variation.
95
+
96
+ The framework provides the infrastructure to convert MAESTER, scmtATAC-seq and RedeeM pre-processing outputs
97
+ into Allele Frequency Matrices (i.e., [AnnData](https://anndata.readthedocs.io/) objects), filter informative mtDNA variants, genotype individual cells, and
98
+ infer mitochondrial phylogenies and clones for dowstream multi-omic analysis.
99
+
100
+ ## Installation
101
+
102
+ ```bash
103
+ pip install scmito
104
+ ```
105
+
106
+ Requires Python 3.11+.
107
+
108
+ ```python
109
+ import mito as mt
110
+ print(mt.__version__)
111
+ ```
112
+
113
+ ## Quick start
114
+
115
+ ```python
116
+ import scanpy as sc
117
+ import mito as mt
118
+
119
+ # Allele Frequency Matrix (cell x site AnnData with AD / DP layers)
120
+ afm = sc.read('afm_unfiltered.h5ad')
121
+
122
+ # Cell and variant filters, distances in mtDNA mutation space
123
+ afm = mt.pp.filter_cells(afm, cell_filter='filter2')
124
+ afm = mt.pp.filter_afm(afm, filtering='MiTo')
125
+
126
+ # Phylogeny and clonal inference
127
+ tree = mt.tl.build_tree(afm, precomputed=True, solver='UPMGA')
128
+ annotator = mt.tl.MiToTreeAnnotator(tree)
129
+ annotator.clonal_inference()
130
+
131
+ # Visualization
132
+ mt.pl.plot_tree(tree, features=['MiTo clone'])
133
+ ```
134
+
135
+ See [getting-started tutorial](https://scmito.readthedocs.io/en/latest/getting_started_tutorial.html) for
136
+ the full vignette.
137
+
138
+ ## API
139
+
140
+ MiTo follows the `scverse` layout, composing with `scanpy` and `anndata`:
141
+
142
+ | Module | Purpose |
143
+ | --- | --- |
144
+ | `io` | Build AFMs from pre-processing outputs, read/write Newick tree objects |
145
+ | `pp` | Cell and variant filtering, genotying, distances, kNN graphs, embeddings |
146
+ | `tl` | Tree building, clonal inference, clustering, fate bias |
147
+ | `pl` | Trees, heatmaps, embeddings, coverage and variant-spectrum plots |
148
+ | `ut` | Metrics, helpers |
149
+
150
+ **Supported platforms:** scRNA-seq (MAESTER), scmtATAC-seq and 10x MultiOme (RedeeM).
151
+
152
+ Full reference: [MiTo docs](https://scmito.readthedocs.io/en/latest/index.html).
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ git clone https://github.com/andrecossa5/MiTo.git
158
+ cd MiTo
159
+ pip install -e ".[test]"
160
+ pytest
161
+ ```
162
+
163
+ ## Citation
164
+
165
+ If MiTo is useful in your work, please cite:
166
+
167
+ > Cossa, A. Dalmasso A. et al. *MiTo: mitochondrial lineage tracing and single-cell multi-omics.*
168
+ > Nat Comm (2026). [https://doi.org/10.1038/s41467-026-71607-5](https://www.nature.com/articles/s41467-026-71607-5)
169
+
170
+ MiTo builds on the [Cassiopeia](https://github.com/YosefLab/Cassiopeia) package for phylogeny reconstruction and data infrastructure. Please, cite it as well.
171
+
172
+ ## Releases
173
+
174
+ See [CHANGELOG.md](CHANGELOG.md).
175
+
176
+ ## License
177
+
178
+ MIT — see [LICENSE](LICENSE).
scmito-0.2.0/README.md ADDED
@@ -0,0 +1,99 @@
1
+ <div align="center">
2
+ <img src="image/MiTo_logo_transparent.png" alt="MiTo" width="260">
3
+ </div>
4
+
5
+ # MiTo (Mitochondrial single-cell lineage tracing Toolkit)
6
+
7
+ **Mitochondrial single-cell multi-omics in Python.**
8
+
9
+ [![PyPI](https://img.shields.io/pypi/v/scmito.svg)](https://pypi.org/project/scmito/)
10
+ [![Python](https://img.shields.io/pypi/pyversions/scmito.svg)](https://pypi.org/project/scmito/)
11
+ [![Tests](https://github.com/andrecossa5/MiTo/actions/workflows/test.yml/badge.svg)](https://github.com/andrecossa5/MiTo/actions/workflows/test.yml)
12
+ [![Documentation](https://readthedocs.org/projects/scmito/badge/?version=latest)](https://scmito.readthedocs.io/en/latest/index.html)
13
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
14
+
15
+ **MiTo** infer clonal ancestries in single-cell data from natural mtDNA variation.
16
+
17
+ The framework provides the infrastructure to convert MAESTER, scmtATAC-seq and RedeeM pre-processing outputs
18
+ into Allele Frequency Matrices (i.e., [AnnData](https://anndata.readthedocs.io/) objects), filter informative mtDNA variants, genotype individual cells, and
19
+ infer mitochondrial phylogenies and clones for dowstream multi-omic analysis.
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ pip install scmito
25
+ ```
26
+
27
+ Requires Python 3.11+.
28
+
29
+ ```python
30
+ import mito as mt
31
+ print(mt.__version__)
32
+ ```
33
+
34
+ ## Quick start
35
+
36
+ ```python
37
+ import scanpy as sc
38
+ import mito as mt
39
+
40
+ # Allele Frequency Matrix (cell x site AnnData with AD / DP layers)
41
+ afm = sc.read('afm_unfiltered.h5ad')
42
+
43
+ # Cell and variant filters, distances in mtDNA mutation space
44
+ afm = mt.pp.filter_cells(afm, cell_filter='filter2')
45
+ afm = mt.pp.filter_afm(afm, filtering='MiTo')
46
+
47
+ # Phylogeny and clonal inference
48
+ tree = mt.tl.build_tree(afm, precomputed=True, solver='UPMGA')
49
+ annotator = mt.tl.MiToTreeAnnotator(tree)
50
+ annotator.clonal_inference()
51
+
52
+ # Visualization
53
+ mt.pl.plot_tree(tree, features=['MiTo clone'])
54
+ ```
55
+
56
+ See [getting-started tutorial](https://scmito.readthedocs.io/en/latest/getting_started_tutorial.html) for
57
+ the full vignette.
58
+
59
+ ## API
60
+
61
+ MiTo follows the `scverse` layout, composing with `scanpy` and `anndata`:
62
+
63
+ | Module | Purpose |
64
+ | --- | --- |
65
+ | `io` | Build AFMs from pre-processing outputs, read/write Newick tree objects |
66
+ | `pp` | Cell and variant filtering, genotying, distances, kNN graphs, embeddings |
67
+ | `tl` | Tree building, clonal inference, clustering, fate bias |
68
+ | `pl` | Trees, heatmaps, embeddings, coverage and variant-spectrum plots |
69
+ | `ut` | Metrics, helpers |
70
+
71
+ **Supported platforms:** scRNA-seq (MAESTER), scmtATAC-seq and 10x MultiOme (RedeeM).
72
+
73
+ Full reference: [MiTo docs](https://scmito.readthedocs.io/en/latest/index.html).
74
+
75
+ ## Development
76
+
77
+ ```bash
78
+ git clone https://github.com/andrecossa5/MiTo.git
79
+ cd MiTo
80
+ pip install -e ".[test]"
81
+ pytest
82
+ ```
83
+
84
+ ## Citation
85
+
86
+ If MiTo is useful in your work, please cite:
87
+
88
+ > Cossa, A. Dalmasso A. et al. *MiTo: mitochondrial lineage tracing and single-cell multi-omics.*
89
+ > Nat Comm (2026). [https://doi.org/10.1038/s41467-026-71607-5](https://www.nature.com/articles/s41467-026-71607-5)
90
+
91
+ MiTo builds on the [Cassiopeia](https://github.com/YosefLab/Cassiopeia) package for phylogeny reconstruction and data infrastructure. Please, cite it as well.
92
+
93
+ ## Releases
94
+
95
+ See [CHANGELOG.md](CHANGELOG.md).
96
+
97
+ ## License
98
+
99
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,141 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "scmito"
7
+ dynamic = ["version"]
8
+ description = "Mitochondrial lineage tracing and single-cell multi-omics in Python"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">=3.11"
12
+ authors = [{ name = "Andrea Cossa", email = "andrea.cossa05@gmail.com" }]
13
+ keywords = [
14
+ "single-cell",
15
+ "lineage-tracing",
16
+ "mitochondrial-DNA",
17
+ "phylogenetics",
18
+ "scLT",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 4 - Beta",
22
+ "Intended Audience :: Science/Research",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: POSIX :: Linux",
25
+ "Operating System :: MacOS :: MacOS X",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
31
+ ]
32
+
33
+ dependencies = [
34
+
35
+ # core scientific stack
36
+ "numpy>=1.26",
37
+ "scipy>=1.11",
38
+ "pandas>=2.2",
39
+ "statsmodels>=0.14",
40
+ "scikit-learn>=1.4",
41
+ "joblib>=1.3",
42
+ "tqdm>=4.60",
43
+
44
+ # scverse
45
+ "anndata>=0.10",
46
+ "scanpy>=1.10",
47
+
48
+ # plotting
49
+ "matplotlib>=3.8",
50
+ "seaborn>=0.13",
51
+ "ac-plotting-ut>=0.2.1",
52
+ "circlify>=0.15",
53
+
54
+ # graphs and embeddings
55
+ "networkx>=3.1",
56
+ "igraph>=0.10",
57
+ "leidenalg>=0.10",
58
+ "umap-learn>=0.5",
59
+ # phylogenetics
60
+ "cassiopeia-mt>=2.1.3",
61
+ "biopython>=1.80",
62
+
63
+ # variant calling / modelling
64
+ "mquad>=0.1.8",
65
+ "bbmix>=0.1",
66
+ "lightgbm>=4.0",
67
+ "shap>=0.44",
68
+
69
+ # Others
70
+ "gseapy>=1.1"
71
+
72
+ ]
73
+
74
+ [project.optional-dependencies]
75
+ test = ["pytest>=7.0", "pytest-cov>=4.0"]
76
+ docs = [
77
+ "sphinx>=7",
78
+ "furo",
79
+ "nbsphinx",
80
+ "sphinx-copybutton",
81
+ "sphinx-design",
82
+ "ipykernel",
83
+ ]
84
+
85
+ [project.urls]
86
+ Homepage = "https://github.com/andrecossa5/MiTo"
87
+ Documentation = "https://scmito.readthedocs.io/en/latest/index.html"
88
+ Repository = "https://github.com/andrecossa5/MiTo"
89
+ Issues = "https://github.com/andrecossa5/MiTo/issues"
90
+
91
+ [tool.hatch.version]
92
+ path = "src/mito/__init__.py"
93
+
94
+ [tool.hatch.build.targets.wheel]
95
+ packages = ["src/mito"]
96
+
97
+ [tool.hatch.build.targets.sdist]
98
+ include = ["src/mito", "tests", "README.md", "LICENSE", "CHANGELOG.md"]
99
+
100
+ [tool.pytest.ini_options]
101
+ testpaths = ["tests"]
102
+ addopts = "-v"
103
+
104
+ [tool.ruff]
105
+ line-length = 120
106
+ src = ["src"]
107
+ extend-include = ["*.ipynb"]
108
+ format.docstring-code-format = true
109
+ lint.select = [
110
+ "B", # flake8-bugbear
111
+ "BLE", # flake8-blind-except
112
+ "C4", # flake8-comprehensions
113
+ "E", # pycodestyle errors
114
+ "F", # pyflakes
115
+ "I", # isort
116
+ "RUF100", # unused noqa directives
117
+ "TID", # flake8-tidy-imports
118
+ "UP", # pyupgrade
119
+ "W", # pycodestyle warnings
120
+ ]
121
+ lint.ignore = [
122
+ "B008", # function calls in argument defaults -- fine when the result is immutable
123
+ "E501", # long lines: long comments are accepted, the formatter handles code
124
+ "E731", # lambda assignment is convenient
125
+ "E741", # allow I, O, l as names -- I is the identity matrix
126
+ ]
127
+ lint.per-file-ignores."*/__init__.py" = ["F401"]
128
+ lint.per-file-ignores."docs/*" = ["I"]
129
+ lint.per-file-ignores."tests/*" = ["D"]
130
+ lint.pydocstyle.convention = "numpy"
131
+
132
+ [tool.codespell]
133
+ skip = ".git,*.ipynb,*.csv,*.txt,*.fa,*.gz,docs/_build"
134
+ # NB: "treshold"/"tresh" and "indeces" appear in public parameter names
135
+ # (e.g. MiToTreeAnnotator.clonal_inference(similarity_tresholds=...)), so they are
136
+ # ignored rather than corrected: fixing them would be a breaking API change.
137
+ ignore-words-list = "coo,nd,ist,hist,mut,muts,ND,SNS,treshold,tresholds,tresh,indeces,simmetric"
138
+
139
+ [tool.coverage.run]
140
+ source = ["mito"]
141
+ omit = ["*/tests/*"]
@@ -0,0 +1,5 @@
1
+ __version__ = "0.2.0"
2
+
3
+ from . import io, pl, pp, tl, ut
4
+
5
+ __all__ = ["pl", "pp", "tl", "io", "ut"]
File without changes