combatlearn 0.2.2__tar.gz → 1.1.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.
- {combatlearn-0.2.2/combatlearn.egg-info → combatlearn-1.1.0}/PKG-INFO +36 -8
- combatlearn-0.2.2/PKG-INFO → combatlearn-1.1.0/README.md +25 -30
- combatlearn-1.1.0/combatlearn/__init__.py +5 -0
- {combatlearn-0.2.2 → combatlearn-1.1.0}/combatlearn/combat.py +780 -40
- combatlearn-0.2.2/README.md → combatlearn-1.1.0/combatlearn.egg-info/PKG-INFO +58 -6
- {combatlearn-0.2.2 → combatlearn-1.1.0}/combatlearn.egg-info/SOURCES.txt +1 -0
- combatlearn-1.1.0/combatlearn.egg-info/requires.txt +19 -0
- {combatlearn-0.2.2 → combatlearn-1.1.0}/pyproject.toml +20 -12
- combatlearn-0.2.2/combatlearn.egg-info/requires.txt → combatlearn-1.1.0/requirements.txt +1 -2
- combatlearn-1.1.0/tests/test_combat.py +489 -0
- combatlearn-0.2.2/combatlearn/__init__.py +0 -4
- combatlearn-0.2.2/tests/test_combat.py +0 -150
- {combatlearn-0.2.2 → combatlearn-1.1.0}/LICENSE +0 -0
- {combatlearn-0.2.2 → combatlearn-1.1.0}/combatlearn.egg-info/dependency_links.txt +0 -0
- {combatlearn-0.2.2 → combatlearn-1.1.0}/combatlearn.egg-info/top_level.txt +0 -0
- {combatlearn-0.2.2 → combatlearn-1.1.0}/setup.cfg +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: combatlearn
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Batch-effect harmonization for machine learning frameworks.
|
|
5
5
|
Author-email: Ettore Rocchi <ettoreroc@gmail.com>
|
|
6
|
-
License
|
|
6
|
+
License: MIT
|
|
7
7
|
Keywords: machine-learning,harmonization,combat,preprocessing
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -19,13 +19,23 @@ Requires-Dist: matplotlib>=3.4
|
|
|
19
19
|
Requires-Dist: plotly>=5.0
|
|
20
20
|
Requires-Dist: nbformat>=4.2
|
|
21
21
|
Requires-Dist: umap-learn>=0.5
|
|
22
|
-
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff>=0.1; extra == "dev"
|
|
26
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
27
|
+
Provides-Extra: docs
|
|
28
|
+
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
29
|
+
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
30
|
+
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == "docs"
|
|
31
|
+
Requires-Dist: pymdown-extensions>=10.0; extra == "docs"
|
|
23
32
|
Dynamic: license-file
|
|
24
33
|
|
|
25
34
|
# **combatlearn**
|
|
26
35
|
|
|
27
36
|
[](https://www.python.org/)
|
|
28
37
|
[](https://github.com/EttoreRocchi/combatlearn/actions/workflows/test.yaml)
|
|
38
|
+
[](https://combatlearn.readthedocs.io)
|
|
29
39
|
[](https://pepy.tech/projects/combatlearn)
|
|
30
40
|
[](https://pypi.org/project/combatlearn/)
|
|
31
41
|
[](https://github.com/EttoreRocchi/combatlearn/blob/main/LICENSE)
|
|
@@ -47,8 +57,21 @@ Dynamic: license-file
|
|
|
47
57
|
pip install combatlearn
|
|
48
58
|
```
|
|
49
59
|
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
**Full documentation is available at [combatlearn.readthedocs.io](https://combatlearn.readthedocs.io)**
|
|
63
|
+
|
|
64
|
+
The documentation includes:
|
|
65
|
+
- [Installation Guide](https://combatlearn.readthedocs.io/en/latest/installation/)
|
|
66
|
+
- [Quick Start Tutorial](https://combatlearn.readthedocs.io/en/latest/quickstart/)
|
|
67
|
+
- [User Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/overview/)
|
|
68
|
+
- [API Reference](https://combatlearn.readthedocs.io/en/latest/api/)
|
|
69
|
+
- [Examples](https://combatlearn.readthedocs.io/en/latest/examples/basic-usage/)
|
|
70
|
+
|
|
50
71
|
## Quick start
|
|
51
72
|
|
|
73
|
+
For more details, see the [Quick Start Tutorial](https://combatlearn.readthedocs.io/en/latest/quickstart/).
|
|
74
|
+
|
|
52
75
|
```python
|
|
53
76
|
import pandas as pd
|
|
54
77
|
from sklearn.pipeline import Pipeline
|
|
@@ -97,7 +120,7 @@ For a full example of how to use **combatlearn** see the [notebook demo](https:/
|
|
|
97
120
|
|
|
98
121
|
## `ComBat` parameters
|
|
99
122
|
|
|
100
|
-
The following section provides a detailed explanation of all parameters available in the scikit-learn-compatible `ComBat` class.
|
|
123
|
+
The following section provides a detailed explanation of all parameters available in the scikit-learn-compatible `ComBat` class. For complete API documentation, see the [API Reference](https://combatlearn.readthedocs.io/en/latest/api/).
|
|
101
124
|
|
|
102
125
|
### Main Parameters
|
|
103
126
|
|
|
@@ -119,11 +142,17 @@ The following section provides a detailed explanation of all parameters availabl
|
|
|
119
142
|
| `eps` | float | `1e-8` | Small jitter value added to variances to prevent divide-by-zero errors during standardization. |
|
|
120
143
|
|
|
121
144
|
|
|
122
|
-
### Batch Effect Correction Visualization
|
|
145
|
+
### Batch Effect Correction Visualization
|
|
123
146
|
|
|
124
147
|
The `plot_transformation` method allows to visualize the **ComBat** transformation effect using dimensionality reduction, showing the before/after comparison of data transformed by `ComBat` using PCA, t-SNE, or UMAP to reduce dimensions for visualization.
|
|
125
148
|
|
|
126
|
-
For further details see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
|
|
149
|
+
For further details see the [Visualization Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/visualization/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
|
|
150
|
+
|
|
151
|
+
### Batch Effect Metrics
|
|
152
|
+
|
|
153
|
+
The `compute_batch_metrics` method provides quantitative assessment of batch correction quality. It computes metrics including Silhouette coefficient, Davies-Bouldin index, kBET, LISI, and variance ratio for batch effect quantification, as well as k-NN preservation and distance correlation for structure preservation.
|
|
154
|
+
|
|
155
|
+
For further details see the [Metrics Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/metrics/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
|
|
127
156
|
|
|
128
157
|
## Contributing
|
|
129
158
|
|
|
@@ -146,8 +175,7 @@ We gratefully acknowledge:
|
|
|
146
175
|
|
|
147
176
|
## Citation
|
|
148
177
|
|
|
149
|
-
If **combatlearn** is useful in your research, please cite the original
|
|
150
|
-
papers:
|
|
178
|
+
If **combatlearn** is useful in your research, please cite the original papers:
|
|
151
179
|
|
|
152
180
|
- Johnson WE, Li C, Rabinovic A. Adjusting batch effects in microarray expression data using empirical Bayes methods. _Biostatistics_. 2007 Jan;8(1):118-27. doi: [10.1093/biostatistics/kxj037](https://doi.org/10.1093/biostatistics/kxj037)
|
|
153
181
|
|
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: combatlearn
|
|
3
|
-
Version: 0.2.2
|
|
4
|
-
Summary: Batch-effect harmonization for machine learning frameworks.
|
|
5
|
-
Author-email: Ettore Rocchi <ettoreroc@gmail.com>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Keywords: machine-learning,harmonization,combat,preprocessing
|
|
8
|
-
Classifier: Development Status :: 3 - Alpha
|
|
9
|
-
Classifier: Intended Audience :: Science/Research
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Requires-Python: >=3.10
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: pandas>=1.3
|
|
16
|
-
Requires-Dist: numpy>=1.21
|
|
17
|
-
Requires-Dist: scikit-learn>=1.2
|
|
18
|
-
Requires-Dist: matplotlib>=3.4
|
|
19
|
-
Requires-Dist: plotly>=5.0
|
|
20
|
-
Requires-Dist: nbformat>=4.2
|
|
21
|
-
Requires-Dist: umap-learn>=0.5
|
|
22
|
-
Requires-Dist: pytest>=7
|
|
23
|
-
Dynamic: license-file
|
|
24
|
-
|
|
25
1
|
# **combatlearn**
|
|
26
2
|
|
|
27
3
|
[](https://www.python.org/)
|
|
28
4
|
[](https://github.com/EttoreRocchi/combatlearn/actions/workflows/test.yaml)
|
|
5
|
+
[](https://combatlearn.readthedocs.io)
|
|
29
6
|
[](https://pepy.tech/projects/combatlearn)
|
|
30
7
|
[](https://pypi.org/project/combatlearn/)
|
|
31
8
|
[](https://github.com/EttoreRocchi/combatlearn/blob/main/LICENSE)
|
|
@@ -47,8 +24,21 @@ Dynamic: license-file
|
|
|
47
24
|
pip install combatlearn
|
|
48
25
|
```
|
|
49
26
|
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
**Full documentation is available at [combatlearn.readthedocs.io](https://combatlearn.readthedocs.io)**
|
|
30
|
+
|
|
31
|
+
The documentation includes:
|
|
32
|
+
- [Installation Guide](https://combatlearn.readthedocs.io/en/latest/installation/)
|
|
33
|
+
- [Quick Start Tutorial](https://combatlearn.readthedocs.io/en/latest/quickstart/)
|
|
34
|
+
- [User Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/overview/)
|
|
35
|
+
- [API Reference](https://combatlearn.readthedocs.io/en/latest/api/)
|
|
36
|
+
- [Examples](https://combatlearn.readthedocs.io/en/latest/examples/basic-usage/)
|
|
37
|
+
|
|
50
38
|
## Quick start
|
|
51
39
|
|
|
40
|
+
For more details, see the [Quick Start Tutorial](https://combatlearn.readthedocs.io/en/latest/quickstart/).
|
|
41
|
+
|
|
52
42
|
```python
|
|
53
43
|
import pandas as pd
|
|
54
44
|
from sklearn.pipeline import Pipeline
|
|
@@ -97,7 +87,7 @@ For a full example of how to use **combatlearn** see the [notebook demo](https:/
|
|
|
97
87
|
|
|
98
88
|
## `ComBat` parameters
|
|
99
89
|
|
|
100
|
-
The following section provides a detailed explanation of all parameters available in the scikit-learn-compatible `ComBat` class.
|
|
90
|
+
The following section provides a detailed explanation of all parameters available in the scikit-learn-compatible `ComBat` class. For complete API documentation, see the [API Reference](https://combatlearn.readthedocs.io/en/latest/api/).
|
|
101
91
|
|
|
102
92
|
### Main Parameters
|
|
103
93
|
|
|
@@ -119,11 +109,17 @@ The following section provides a detailed explanation of all parameters availabl
|
|
|
119
109
|
| `eps` | float | `1e-8` | Small jitter value added to variances to prevent divide-by-zero errors during standardization. |
|
|
120
110
|
|
|
121
111
|
|
|
122
|
-
### Batch Effect Correction Visualization
|
|
112
|
+
### Batch Effect Correction Visualization
|
|
123
113
|
|
|
124
114
|
The `plot_transformation` method allows to visualize the **ComBat** transformation effect using dimensionality reduction, showing the before/after comparison of data transformed by `ComBat` using PCA, t-SNE, or UMAP to reduce dimensions for visualization.
|
|
125
115
|
|
|
126
|
-
For further details see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
|
|
116
|
+
For further details see the [Visualization Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/visualization/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
|
|
117
|
+
|
|
118
|
+
### Batch Effect Metrics
|
|
119
|
+
|
|
120
|
+
The `compute_batch_metrics` method provides quantitative assessment of batch correction quality. It computes metrics including Silhouette coefficient, Davies-Bouldin index, kBET, LISI, and variance ratio for batch effect quantification, as well as k-NN preservation and distance correlation for structure preservation.
|
|
121
|
+
|
|
122
|
+
For further details see the [Metrics Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/metrics/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
|
|
127
123
|
|
|
128
124
|
## Contributing
|
|
129
125
|
|
|
@@ -146,11 +142,10 @@ We gratefully acknowledge:
|
|
|
146
142
|
|
|
147
143
|
## Citation
|
|
148
144
|
|
|
149
|
-
If **combatlearn** is useful in your research, please cite the original
|
|
150
|
-
papers:
|
|
145
|
+
If **combatlearn** is useful in your research, please cite the original papers:
|
|
151
146
|
|
|
152
147
|
- Johnson WE, Li C, Rabinovic A. Adjusting batch effects in microarray expression data using empirical Bayes methods. _Biostatistics_. 2007 Jan;8(1):118-27. doi: [10.1093/biostatistics/kxj037](https://doi.org/10.1093/biostatistics/kxj037)
|
|
153
148
|
|
|
154
149
|
- Fortin JP, Cullen N, Sheline YI, Taylor WD, Aselcioglu I, Cook PA, Adams P, Cooper C, Fava M, McGrath PJ, McInnis M, Phillips ML, Trivedi MH, Weissman MM, Shinohara RT. Harmonization of cortical thickness measurements across scanners and sites. _Neuroimage_. 2018 Feb 15;167:104-120. doi: [10.1016/j.neuroimage.2017.11.024](https://doi.org/10.1016/j.neuroimage.2017.11.024)
|
|
155
150
|
|
|
156
|
-
- Chen AA, Beer JC, Tustison NJ, Cook PA, Shinohara RT, Shou H; Alzheimer's Disease Neuroimaging Initiative. Mitigating site effects in covariance for machine learning in neuroimaging data. _Hum Brain Mapp_. 2022 Mar;43(4):1179-1195. doi: [10.1002/hbm.25688](https://doi.org/10.1002/hbm.25688)
|
|
151
|
+
- Chen AA, Beer JC, Tustison NJ, Cook PA, Shinohara RT, Shou H; Alzheimer's Disease Neuroimaging Initiative. Mitigating site effects in covariance for machine learning in neuroimaging data. _Hum Brain Mapp_. 2022 Mar;43(4):1179-1195. doi: [10.1002/hbm.25688](https://doi.org/10.1002/hbm.25688)
|