combatlearn 1.0.0__tar.gz → 1.1.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: combatlearn
3
- Version: 1.0.0
3
+ Version: 1.1.1
4
4
  Summary: Batch-effect harmonization for machine learning frameworks.
5
5
  Author-email: Ettore Rocchi <ettoreroc@gmail.com>
6
6
  License: MIT
@@ -21,14 +21,14 @@ Requires-Dist: nbformat>=4.2
21
21
  Requires-Dist: umap-learn>=0.5
22
22
  Provides-Extra: dev
23
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"
24
+ Requires-Dist: ruff>=0.8; extra == "dev"
25
+ Requires-Dist: pre-commit>=3.0; extra == "dev"
27
26
  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"
27
+ Requires-Dist: sphinx>=7.0.0; extra == "docs"
28
+ Requires-Dist: pydata-sphinx-theme>=0.15.0; extra == "docs"
29
+ Requires-Dist: myst-parser>=3.0.0; extra == "docs"
30
+ Requires-Dist: sphinx-copybutton>=0.5.0; extra == "docs"
31
+ Requires-Dist: linkify-it-py>=2.0.0; extra == "docs"
32
32
  Dynamic: license-file
33
33
 
34
34
  # **combatlearn**
@@ -41,7 +41,7 @@ Dynamic: license-file
41
41
  [![License](https://img.shields.io/github/license/EttoreRocchi/combatlearn)](https://github.com/EttoreRocchi/combatlearn/blob/main/LICENSE)
42
42
 
43
43
  <div align="center">
44
- <p><img src="https://raw.githubusercontent.com/EttoreRocchi/combatlearn/main/docs/logo.png" alt="combatlearn logo" width="350" /></p>
44
+ <p><img src="https://raw.githubusercontent.com/EttoreRocchi/combatlearn/main/docs/source/_static/logo.png" alt="combatlearn logo" width="350" /></p>
45
45
  </div>
46
46
 
47
47
  **combatlearn** makes the popular _ComBat_ (and _CovBat_) batch-effect correction algorithm available for use into machine learning frameworks. It lets you harmonise high-dimensional data inside a scikit-learn `Pipeline`, so that cross-validation and grid-search automatically take batch structure into account, **without data leakage**.
@@ -57,6 +57,14 @@ Dynamic: license-file
57
57
  pip install combatlearn
58
58
  ```
59
59
 
60
+ ## Documentation
61
+
62
+ **Full documentation is available at [combatlearn.readthedocs.io](https://combatlearn.readthedocs.io)**
63
+
64
+ The documentation includes:
65
+ - [Methods Guide](https://combatlearn.readthedocs.io/en/latest/methods/)
66
+ - [API Reference](https://combatlearn.readthedocs.io/en/latest/api/)
67
+
60
68
  ## Quick start
61
69
 
62
70
  ```python
@@ -103,22 +111,11 @@ print("Best parameters:", grid.best_params_)
103
111
  print(f"Best CV AUROC: {grid.best_score_:.3f}")
104
112
  ```
105
113
 
106
- For a full example of how to use **combatlearn** see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb)
107
-
108
- ## Documentation
109
-
110
- **Full documentation is available at [combatlearn.readthedocs.io](https://combatlearn.readthedocs.io)**
111
-
112
- The documentation includes:
113
- - [Installation Guide](https://combatlearn.readthedocs.io/en/latest/installation/)
114
- - [Quick Start Tutorial](https://combatlearn.readthedocs.io/en/latest/quickstart/)
115
- - [User Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/overview/)
116
- - [API Reference](https://combatlearn.readthedocs.io/en/latest/api/)
117
- - [Examples](https://combatlearn.readthedocs.io/en/latest/examples/basic-usage/)
114
+ For a full example of how to use **combatlearn** see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/source/demo/combatlearn_demo.ipynb)
118
115
 
119
116
  ## `ComBat` parameters
120
117
 
121
- The following section provides a detailed explanation of all parameters available in the scikit-learn-compatible `ComBat` class.
118
+ 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/).
122
119
 
123
120
  ### Main Parameters
124
121
 
@@ -140,11 +137,17 @@ The following section provides a detailed explanation of all parameters availabl
140
137
  | `eps` | float | `1e-8` | Small jitter value added to variances to prevent divide-by-zero errors during standardization. |
141
138
 
142
139
 
143
- ### Batch Effect Correction Visualization
140
+ ### Batch Effect Correction Visualization
144
141
 
145
142
  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.
146
143
 
147
- For further details see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
144
+ For further details see the [API Reference](https://combatlearn.readthedocs.io/en/latest/api/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/source/demo/combatlearn_demo.ipynb).
145
+
146
+ ### Batch Effect Metrics
147
+
148
+ 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.
149
+
150
+ For further details see the [API Reference](https://combatlearn.readthedocs.io/en/latest/api/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/source/demo/combatlearn_demo.ipynb).
148
151
 
149
152
  ## Contributing
150
153
 
@@ -167,8 +170,7 @@ We gratefully acknowledge:
167
170
 
168
171
  ## Citation
169
172
 
170
- If **combatlearn** is useful in your research, please cite the original
171
- papers:
173
+ If **combatlearn** is useful in your research, please cite the original papers:
172
174
 
173
175
  - 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)
174
176
 
@@ -8,7 +8,7 @@
8
8
  [![License](https://img.shields.io/github/license/EttoreRocchi/combatlearn)](https://github.com/EttoreRocchi/combatlearn/blob/main/LICENSE)
9
9
 
10
10
  <div align="center">
11
- <p><img src="https://raw.githubusercontent.com/EttoreRocchi/combatlearn/main/docs/logo.png" alt="combatlearn logo" width="350" /></p>
11
+ <p><img src="https://raw.githubusercontent.com/EttoreRocchi/combatlearn/main/docs/source/_static/logo.png" alt="combatlearn logo" width="350" /></p>
12
12
  </div>
13
13
 
14
14
  **combatlearn** makes the popular _ComBat_ (and _CovBat_) batch-effect correction algorithm available for use into machine learning frameworks. It lets you harmonise high-dimensional data inside a scikit-learn `Pipeline`, so that cross-validation and grid-search automatically take batch structure into account, **without data leakage**.
@@ -24,6 +24,14 @@
24
24
  pip install combatlearn
25
25
  ```
26
26
 
27
+ ## Documentation
28
+
29
+ **Full documentation is available at [combatlearn.readthedocs.io](https://combatlearn.readthedocs.io)**
30
+
31
+ The documentation includes:
32
+ - [Methods Guide](https://combatlearn.readthedocs.io/en/latest/methods/)
33
+ - [API Reference](https://combatlearn.readthedocs.io/en/latest/api/)
34
+
27
35
  ## Quick start
28
36
 
29
37
  ```python
@@ -70,22 +78,11 @@ print("Best parameters:", grid.best_params_)
70
78
  print(f"Best CV AUROC: {grid.best_score_:.3f}")
71
79
  ```
72
80
 
73
- For a full example of how to use **combatlearn** see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb)
74
-
75
- ## Documentation
76
-
77
- **Full documentation is available at [combatlearn.readthedocs.io](https://combatlearn.readthedocs.io)**
78
-
79
- The documentation includes:
80
- - [Installation Guide](https://combatlearn.readthedocs.io/en/latest/installation/)
81
- - [Quick Start Tutorial](https://combatlearn.readthedocs.io/en/latest/quickstart/)
82
- - [User Guide](https://combatlearn.readthedocs.io/en/latest/user-guide/overview/)
83
- - [API Reference](https://combatlearn.readthedocs.io/en/latest/api/)
84
- - [Examples](https://combatlearn.readthedocs.io/en/latest/examples/basic-usage/)
81
+ For a full example of how to use **combatlearn** see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/source/demo/combatlearn_demo.ipynb)
85
82
 
86
83
  ## `ComBat` parameters
87
84
 
88
- The following section provides a detailed explanation of all parameters available in the scikit-learn-compatible `ComBat` class.
85
+ 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/).
89
86
 
90
87
  ### Main Parameters
91
88
 
@@ -107,11 +104,17 @@ The following section provides a detailed explanation of all parameters availabl
107
104
  | `eps` | float | `1e-8` | Small jitter value added to variances to prevent divide-by-zero errors during standardization. |
108
105
 
109
106
 
110
- ### Batch Effect Correction Visualization
107
+ ### Batch Effect Correction Visualization
111
108
 
112
109
  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.
113
110
 
114
- For further details see the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/demo/combatlearn_demo.ipynb).
111
+ For further details see the [API Reference](https://combatlearn.readthedocs.io/en/latest/api/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/source/demo/combatlearn_demo.ipynb).
112
+
113
+ ### Batch Effect Metrics
114
+
115
+ 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.
116
+
117
+ For further details see the [API Reference](https://combatlearn.readthedocs.io/en/latest/api/) and the [notebook demo](https://github.com/EttoreRocchi/combatlearn/blob/main/docs/source/demo/combatlearn_demo.ipynb).
115
118
 
116
119
  ## Contributing
117
120
 
@@ -134,8 +137,7 @@ We gratefully acknowledge:
134
137
 
135
138
  ## Citation
136
139
 
137
- If **combatlearn** is useful in your research, please cite the original
138
- papers:
140
+ If **combatlearn** is useful in your research, please cite the original papers:
139
141
 
140
142
  - 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)
141
143
 
@@ -0,0 +1,5 @@
1
+ from .combat import ComBat
2
+
3
+ __all__ = ["ComBat"]
4
+ __version__ = "1.1.1"
5
+ __author__ = "Ettore Rocchi"