plaseval-report 0.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.
Files changed (99) hide show
  1. plaseval_report-0.1.0/LICENSE +9 -0
  2. plaseval_report-0.1.0/PKG-INFO +327 -0
  3. plaseval_report-0.1.0/README.md +300 -0
  4. plaseval_report-0.1.0/pyproject.toml +64 -0
  5. plaseval_report-0.1.0/pyproject.toml.orig +60 -0
  6. plaseval_report-0.1.0/src/plaseval_report/__init__.py +1 -0
  7. plaseval_report-0.1.0/src/plaseval_report/__main__.py +9 -0
  8. plaseval_report-0.1.0/src/plaseval_report/app/__init__.py +1 -0
  9. plaseval_report-0.1.0/src/plaseval_report/app/get_data_service.py +131 -0
  10. plaseval_report-0.1.0/src/plaseval_report/app/measure_code_header_map.py +190 -0
  11. plaseval_report-0.1.0/src/plaseval_report/cli/__init__.py +1 -0
  12. plaseval_report-0.1.0/src/plaseval_report/cli/assembler.py +30 -0
  13. plaseval_report-0.1.0/src/plaseval_report/cli/assemblers/__init__.py +1 -0
  14. plaseval_report-0.1.0/src/plaseval_report/cli/assemblers/figures.py +37 -0
  15. plaseval_report-0.1.0/src/plaseval_report/cli/assemblers/stats.py +29 -0
  16. plaseval_report-0.1.0/src/plaseval_report/cli/common.py +144 -0
  17. plaseval_report-0.1.0/src/plaseval_report/cli/distribution_factory.py +191 -0
  18. plaseval_report-0.1.0/src/plaseval_report/cli/logging.py +27 -0
  19. plaseval_report-0.1.0/src/plaseval_report/cli/raw_config_reader.py +293 -0
  20. plaseval_report-0.1.0/src/plaseval_report/cli/repeat_stats_factory.py +240 -0
  21. plaseval_report-0.1.0/src/plaseval_report/cli/result_presence_factory.py +187 -0
  22. plaseval_report-0.1.0/src/plaseval_report/cli/utils/__init__.py +1 -0
  23. plaseval_report-0.1.0/src/plaseval_report/cli/utils/assembler.py +23 -0
  24. plaseval_report-0.1.0/src/plaseval_report/cli/utils/join_measures_command.py +77 -0
  25. plaseval_report-0.1.0/src/plaseval_report/cli/versus_factory.py +141 -0
  26. plaseval_report-0.1.0/src/plaseval_report/config/__init__.py +1 -0
  27. plaseval_report-0.1.0/src/plaseval_report/config/assembly/__init__.py +1 -0
  28. plaseval_report-0.1.0/src/plaseval_report/config/assembly/figure_aes.py +155 -0
  29. plaseval_report-0.1.0/src/plaseval_report/config/assembly/labels_factory.py +91 -0
  30. plaseval_report-0.1.0/src/plaseval_report/config/assembly/remove_samples.py +40 -0
  31. plaseval_report-0.1.0/src/plaseval_report/config/assembly/selection_factory.py +99 -0
  32. plaseval_report-0.1.0/src/plaseval_report/config/assembly/statannotate_factory.py +87 -0
  33. plaseval_report-0.1.0/src/plaseval_report/config/schema.py +68 -0
  34. plaseval_report-0.1.0/src/plaseval_report/distribution/__init__.py +1 -0
  35. plaseval_report-0.1.0/src/plaseval_report/distribution/figures/__init__.py +1 -0
  36. plaseval_report-0.1.0/src/plaseval_report/distribution/figures/data.py +54 -0
  37. plaseval_report-0.1.0/src/plaseval_report/distribution/figures/services.py +477 -0
  38. plaseval_report-0.1.0/src/plaseval_report/distribution/stats/__init__.py +1 -0
  39. plaseval_report-0.1.0/src/plaseval_report/distribution/stats/data.py +48 -0
  40. plaseval_report-0.1.0/src/plaseval_report/distribution/stats/services.py +155 -0
  41. plaseval_report-0.1.0/src/plaseval_report/figs/__init__.py +1 -0
  42. plaseval_report-0.1.0/src/plaseval_report/figs/aes_specification.py +25 -0
  43. plaseval_report-0.1.0/src/plaseval_report/figs/item_colors.py +41 -0
  44. plaseval_report-0.1.0/src/plaseval_report/figs/notifier.py +34 -0
  45. plaseval_report-0.1.0/src/plaseval_report/figs/seaborn.py +12 -0
  46. plaseval_report-0.1.0/src/plaseval_report/items.py +186 -0
  47. plaseval_report-0.1.0/src/plaseval_report/join_measures/__init__.py +1 -0
  48. plaseval_report-0.1.0/src/plaseval_report/join_measures/services.py +29 -0
  49. plaseval_report-0.1.0/src/plaseval_report/latex.py +198 -0
  50. plaseval_report-0.1.0/src/plaseval_report/merge_evals/__init__.py +1 -0
  51. plaseval_report-0.1.0/src/plaseval_report/merge_evals/app.py +69 -0
  52. plaseval_report-0.1.0/src/plaseval_report/merge_evals/headers.py +68 -0
  53. plaseval_report-0.1.0/src/plaseval_report/remove_samples/__init__.py +12 -0
  54. plaseval_report-0.1.0/src/plaseval_report/remove_samples/services.py +67 -0
  55. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/__init__.py +1 -0
  56. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/app.py +32 -0
  57. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/eval/__init__.py +1 -0
  58. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/eval/figures/__init__.py +1 -0
  59. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/eval/figures/data.py +52 -0
  60. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/eval/figures/services.py +400 -0
  61. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/header.py +13 -0
  62. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/overview/__init__.py +1 -0
  63. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/overview/figures/__init__.py +1 -0
  64. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/overview/figures/data.py +35 -0
  65. plaseval_report-0.1.0/src/plaseval_report/repeat_stats/overview/figures/services.py +154 -0
  66. plaseval_report-0.1.0/src/plaseval_report/result_presence/__init__.py +1 -0
  67. plaseval_report-0.1.0/src/plaseval_report/result_presence/columns.py +60 -0
  68. plaseval_report-0.1.0/src/plaseval_report/result_presence/figures/__init__.py +1 -0
  69. plaseval_report-0.1.0/src/plaseval_report/result_presence/figures/data.py +40 -0
  70. plaseval_report-0.1.0/src/plaseval_report/result_presence/figures/services.py +230 -0
  71. plaseval_report-0.1.0/src/plaseval_report/result_presence/stats/__init__.py +1 -0
  72. plaseval_report-0.1.0/src/plaseval_report/result_presence/stats/data.py +22 -0
  73. plaseval_report-0.1.0/src/plaseval_report/result_presence/stats/services.py +197 -0
  74. plaseval_report-0.1.0/src/plaseval_report/shared/__init__.py +1 -0
  75. plaseval_report-0.1.0/src/plaseval_report/shared/core/__init__.py +23 -0
  76. plaseval_report-0.1.0/src/plaseval_report/shared/core/namer.py +18 -0
  77. plaseval_report-0.1.0/src/plaseval_report/shared/core/serializer/__init__.py +1 -0
  78. plaseval_report-0.1.0/src/plaseval_report/shared/core/serializer/api.py +55 -0
  79. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/__init__.py +1 -0
  80. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/logging/__init__.py +1 -0
  81. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/logging/configure.py +36 -0
  82. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/logging/settings.py +21 -0
  83. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/pydantic_model/__init__.py +36 -0
  84. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/pydantic_model/options.py +56 -0
  85. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/pydantic_model/serializer.py +53 -0
  86. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/pydantic_model/wrapper.py +23 -0
  87. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/pydantic_model/yaml_bridge.py +79 -0
  88. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/typer.py +327 -0
  89. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/yaml/__init__.py +15 -0
  90. plaseval_report-0.1.0/src/plaseval_report/shared/toolkits/yaml/serializer.py +78 -0
  91. plaseval_report-0.1.0/src/plaseval_report/stats/__init__.py +1 -0
  92. plaseval_report-0.1.0/src/plaseval_report/stats/notifier.py +54 -0
  93. plaseval_report-0.1.0/src/plaseval_report/stats/write_command_helper_tex.py +77 -0
  94. plaseval_report-0.1.0/src/plaseval_report/versus/__init__.py +1 -0
  95. plaseval_report-0.1.0/src/plaseval_report/versus/columns.py +22 -0
  96. plaseval_report-0.1.0/src/plaseval_report/versus/figures/__init__.py +1 -0
  97. plaseval_report-0.1.0/src/plaseval_report/versus/figures/data.py +46 -0
  98. plaseval_report-0.1.0/src/plaseval_report/versus/figures/services.py +323 -0
  99. plaseval_report-0.1.0/src/plaseval_report/versus/stats/__init__.py +1 -0
@@ -0,0 +1,9 @@
1
+ # MIT License
2
+
3
+ Copyright 2026 Victor Epain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,327 @@
1
+ Metadata-Version: 2.3
2
+ Name: plaseval-report
3
+ Version: 0.1.0
4
+ Summary: Generate figures from PlasEval evaluations
5
+ Author: vepain
6
+ Author-email: vepain <victorepain@disroot.org>
7
+ License: # MIT License
8
+
9
+ Copyright 2026 Victor Epain
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ Requires-Dist: loguru>=0.7.3
17
+ Requires-Dist: matplotlib>=3.10.8
18
+ Requires-Dist: pandas[output-formatting]<4.0
19
+ Requires-Dist: pydantic>=2.13.4
20
+ Requires-Dist: pyyaml>=6.0.3
21
+ Requires-Dist: rich>=13.0,<16.0
22
+ Requires-Dist: seaborn<1.0
23
+ Requires-Dist: statannotations>=0.7.2
24
+ Requires-Dist: typer>=0.21.1,<1.0
25
+ Requires-Python: >=3.13
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Report PlasEval evaluations
29
+
30
+ [![PyPI][pypi_badge]][pypi_link]
31
+ [![ty][ty_badge]][ty_link]
32
+ [![Ruff][ruff_badge]][ruff_link]
33
+ [![uv][uv_badge]][uv_link]
34
+ [![Pipeline status][pipeline_badge]][pipeline_link]
35
+ [![License][license_badge]][licence_link]
36
+
37
+ ## Installation
38
+
39
+ ```sh
40
+ git clone
41
+ ```
42
+
43
+ ### With uv (recommended)
44
+
45
+ See also [uv](https://docs.astral.sh/uv/).
46
+
47
+ ```sh
48
+ uv sync
49
+ # For Bash:
50
+ source .venv/bin/activate
51
+ # For Fish:
52
+ source .venv/bin/activate.fish
53
+ ```
54
+
55
+ ### With virtualenv
56
+
57
+ ```bash
58
+ python3.13 -m virtualenv .venv
59
+ source .venv/bin/activate
60
+ python3.13 -m pip install .
61
+ ```
62
+
63
+ ## Usage
64
+
65
+ In a test directory:
66
+
67
+ ```bash
68
+ tests_dir=tests
69
+
70
+ mkdir $tests_dir
71
+ ```
72
+
73
+ The next section is about [PlasEval] `comp` command.
74
+ For [PlasEval] `eval` command, the processes are the same.
75
+
76
+ For more details, use `--help` option:
77
+
78
+ ```bash
79
+ plaseval-report --help
80
+ # or with uv
81
+ uv run plaseval-report --help
82
+ ```
83
+
84
+ ### Input data
85
+
86
+ The main file is a TSV file with the following base content (independent of `comp` or `eval` commands):
87
+
88
+ | Column ID | Type | Description |
89
+ | ------------- | ----- | ------------ |
90
+ | `species_id` | `str` | Species code |
91
+ | `sample_uid` | `str` | Sample UID |
92
+ | `method_code` | `str` | Method code |
93
+
94
+ The following columns are specific to `comp` command:
95
+
96
+ | Column ID | Type | Description | Measure code |
97
+ | --------------- | ------- | -------------------- | ------------ |
98
+ | `Cuts` | `float` | Normalized cut cost | `cuts` |
99
+ | `Joins` | `float` | Normalized join cost | `joins` |
100
+ | `Extra_ctgs` | `float` | Extra contigs cost | `extra` |
101
+ | `Missing_ctgs` | `float` | Missing contigs cost | `miss` |
102
+ | `Dissimilarity` | `float` | Dissimilarity | `diss` |
103
+
104
+ The following columns are specific to `eval` command:
105
+
106
+ | Column ID | Type | Description | Measure code |
107
+ | --------------- | ------- | -------------------- | ------------ |
108
+ | `unw_precision` | `float` | Unweighted precision | `unw_prec` |
109
+ | `unw_recall` | `float` | Unweighted recall | `unw_recall` |
110
+ | `unw_f1` | `float` | Unweighted F1 | `unw_f1` |
111
+ | `w_precision` | `float` | Weighted precision | `w_prec` |
112
+ | `w_recall` | `float` | Weighted recall | `w_recall` |
113
+ | `w_f1` | `float` | Weighted F1 | `w_f1` |
114
+
115
+ The configuration of the figures/stats is detailed in the `config.yaml` file (optional):
116
+
117
+ ```yaml
118
+ #
119
+ # (Optional) Method codes options
120
+ #
121
+ methods:
122
+ #
123
+ # (Optional) List of method codes to consider.
124
+ # If not set, all the method codes are considered, and the order is given by the TSV file.
125
+ # If the key to_show is not set, the method order is given by the `methods` list.
126
+ #
127
+ to_consider:
128
+ - <method_code>
129
+ - ...
130
+ #
131
+ # (Optional) List of method codes to show among the ones in `to_consider`.
132
+ # If the key to_show is set, the method order is given by the `to_show` list.
133
+ #
134
+ to_show:
135
+ - <method_code>
136
+ - ...
137
+ #
138
+ # (Optional) Map method code to labels
139
+ #
140
+ labels:
141
+ #
142
+ # One line labels.
143
+ # If not set, take the wrap labels otherwise the method codes.
144
+ #
145
+ one_line:
146
+ <method_code>: <str>
147
+ ...
148
+ #
149
+ # Labels potentially on several lines.
150
+ # If not set, take the one_line labels otherwise the method codes.
151
+ #
152
+ wrap:
153
+ <method_code>: <str>
154
+ ...
155
+ #
156
+ # (Optional) List of pairs of methods to annotate with stats
157
+ #
158
+ statannotate:
159
+ - - <method_code>
160
+ - <method_code>
161
+ - ...
162
+ #
163
+ # Method figure aesthetics
164
+ #
165
+ fig_aes:
166
+ palette: <str> # default: Set3, see https://matplotlib.org/stable/users/explain/colors/colormaps.html#qualitative
167
+ #
168
+ # Map method to palette index
169
+ # By default follow the order of the methods to show.
170
+ # If one method is missing in the map, automatically set the index to unused ones, then cycle.
171
+ #
172
+ color_indices:
173
+ <method_code>: <int> # The index of the color in the palette
174
+ ...
175
+ #
176
+ # (Optional) Species options
177
+ # It follows the same structure as for `methods`
178
+ #
179
+ species:
180
+ ...
181
+
182
+ #
183
+ # (Optional) Measures options
184
+ #
185
+ measures:
186
+ #
187
+ # (Optional) List of measures to consider.
188
+ # If not set, all the measures are considered, and the order is given by the TSV file.
189
+ #
190
+ to_consider:
191
+ - <measure_code>
192
+ - ...
193
+ #
194
+ # (Optional) List of measures to show among the ones in `to_consider`.
195
+ #
196
+ to_show:
197
+ - <measure_code>
198
+ - ...
199
+ #
200
+ # (Optional) Samples removal strategy (for the methods listed in `methods`).
201
+ # The option is valid for al but result-presence figures and stats.
202
+ #
203
+ remove_samples: fails | nothing # default: fails
204
+ #
205
+ # Figure aesthetics (Optional, everything is optional)
206
+ #
207
+ fig_aes:
208
+ context: notebook | paper | talk | poster # default: notebook
209
+ focus: true | false # default: false
210
+ ```
211
+
212
+ ### PlasEval comp/eval command results
213
+
214
+ In what follow, the same subcommands are available for both `comp` and `eval` commands.
215
+ The only difference is in the name of the measures (specific to `comp` and `eval`).
216
+ In what follow, we focus on the `comp` command.
217
+
218
+ The next section illustrates how to generate the figures.
219
+ Generating the statistics tables is following the same process.
220
+
221
+ ```bash
222
+ plaseval-report comp fig --help
223
+ ```
224
+
225
+ In the next sections, we must tell which methods we want to consider.
226
+
227
+ #### Result presence figures
228
+
229
+ Know for each tool how many samples have been evaluated by [PlasEval]:
230
+
231
+ ```bash
232
+ plaseval-report comp fig res-presence "$merge_evals_tsv" "$figs_dir/res-presence" --config "$config_yaml"
233
+ ```
234
+
235
+ #### Distribution figures
236
+
237
+ ```bash
238
+ plaseval-report comp fig distribution "$merge_evals_tsv" "$figs_dir/distribution" --config "$config_yaml"
239
+ ```
240
+
241
+ #### Versus figures
242
+
243
+ Generate a versus figure:
244
+
245
+ ```bash
246
+ x_axis="pbhmf_rfpl"
247
+ y_axis="gpcc_rfpl"
248
+
249
+ plaseval-report comp fig versus "$merge_evals_tsv" "$figs_dir/versus" "$x_axis" "$y_axis" --config "$config_yaml"
250
+ ```
251
+
252
+ > [!NOTE]
253
+ > Keys `to_show` are ignored in the versus figure.
254
+
255
+ <!-- -->
256
+
257
+ > [!TIP]
258
+ > If you are not setting the option `remove_samples` to `fails`, you can simply list the two methods of the axes in the `to_consider` key.
259
+
260
+ #### Repeat stats figures
261
+
262
+ The above figures use an additional TSV file, `repeat_stats.tsv`:
263
+
264
+ | Column ID | Description |
265
+ | -------------- | ------------ |
266
+ | `sample_uid` | Sample ID |
267
+ | `species_id` | Species ID |
268
+ | `repeat_ratio` | Repeat ratio |
269
+
270
+ An overview:
271
+
272
+ ```bash
273
+ plaseval-report fig repeat-stats overview "$repeat_stats_tsv" "$figs_dir/repeat-stats/overview" --config "$config_yaml"
274
+ ```
275
+
276
+ Evaluation measures according to the repeat ratio:
277
+
278
+ ```bash
279
+ plaseval-report fig repeat-stats eval "$merge_evals_tsv" "$repeat_stats_tsv" "$figs_dir/repeat_stats/eval" --config "$config_yaml"
280
+ ```
281
+
282
+ ### Joining the PlasEval comp and eval evaluations
283
+
284
+ In order to have the `comp` and `eval` figures on the same samples, we can join the two `TSV` files:
285
+
286
+ ```bash
287
+ plaseval-report utils join-measures --help
288
+
289
+ join_tsv=comp_eval_merge_evals.tsv
290
+ plaseval-report utils join-measures "$merge_comp_tsv" "$merge_eval_tsv" "$join_tsv"
291
+ ```
292
+
293
+ Joining the two set of measures is relevant when `remove_samples` option is set to `fails` because filtering on the joined TSV ensures all the samples have a `comp` and a `eval` evaluation.
294
+
295
+ <!-- Links -->
296
+ [PlasEval]: https://github.com/cchauve/PlasEval
297
+
298
+ <!-- Badges -->
299
+
300
+ <!--
301
+ Changes:
302
+
303
+ * PyPI project name `plaseval-report`
304
+ * Git project name `https://gitlab.com/vepain/plaseval_report-py`
305
+ * GitLab project ID `85477466`
306
+ * shields.io GitLab `vepain%2Fplaseval_report-py`
307
+ -->
308
+
309
+ [pypi_badge]: https://img.shields.io/pypi/v/plaseval-report?style=for-the-badge&logo=python&color=blue "Package badge"
310
+ [pypi_link]: https://pypi.org/project/plaseval-report/ "Package link"
311
+
312
+ [ruff_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F85477466%2Fjobs%2Fartifacts%2Fmain%2Fraw%2Fruff%2Fbadge.json%3Fjob%3Druff&style=for-the-badge&logo=ruff&label=Ruff "Ruff badge"
313
+ [ruff_link]: https://gitlab.com/vepain/plaseval_report-py/-/commits/main "Ruff link"
314
+
315
+ <!-- https://gitlab.com/api/v4/projects/85477466/jobs/artifacts/main/raw/ruff/badge.json?job=ruff -->
316
+
317
+ [ty_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F85477466%2Fjobs%2Fartifacts%2Fmain%2Fraw%2Fty%2Fbadge.json%3Fjob%3Dty&style=for-the-badge&logo=ty&label=Ty "ty badge"
318
+ [ty_link]: https://gitlab.com/vepain/plaseval_report-py/-/commits/main "ty link"
319
+
320
+ [uv_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fastral-sh%2Fuv%2Fmain%2Fassets%2Fbadge%2Fv0.json&style=for-the-badge "uv badge"
321
+ [uv_link]: https://docs.astral.sh/uv/ "uv link"
322
+
323
+ [pipeline_badge]: https://img.shields.io/gitlab/pipeline-status/vepain%2Fplaseval_report-py?branch=main&style=for-the-badge&logo=circleci "Pipeline badge"
324
+ [pipeline_link]: https://gitlab.com/vepain/plaseval_report-py/-/commits/main "Pipeline link"
325
+
326
+ [license_badge]: https://img.shields.io/gitlab/license/vepain%2Fplaseval_report-py?style=for-the-badge&logo=readdotcv&color=green "Licence badge"
327
+ [licence_link]: https://gitlab.com/vepain/plaseval_report-py "Licence link"
@@ -0,0 +1,300 @@
1
+ # Report PlasEval evaluations
2
+
3
+ [![PyPI][pypi_badge]][pypi_link]
4
+ [![ty][ty_badge]][ty_link]
5
+ [![Ruff][ruff_badge]][ruff_link]
6
+ [![uv][uv_badge]][uv_link]
7
+ [![Pipeline status][pipeline_badge]][pipeline_link]
8
+ [![License][license_badge]][licence_link]
9
+
10
+ ## Installation
11
+
12
+ ```sh
13
+ git clone
14
+ ```
15
+
16
+ ### With uv (recommended)
17
+
18
+ See also [uv](https://docs.astral.sh/uv/).
19
+
20
+ ```sh
21
+ uv sync
22
+ # For Bash:
23
+ source .venv/bin/activate
24
+ # For Fish:
25
+ source .venv/bin/activate.fish
26
+ ```
27
+
28
+ ### With virtualenv
29
+
30
+ ```bash
31
+ python3.13 -m virtualenv .venv
32
+ source .venv/bin/activate
33
+ python3.13 -m pip install .
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ In a test directory:
39
+
40
+ ```bash
41
+ tests_dir=tests
42
+
43
+ mkdir $tests_dir
44
+ ```
45
+
46
+ The next section is about [PlasEval] `comp` command.
47
+ For [PlasEval] `eval` command, the processes are the same.
48
+
49
+ For more details, use `--help` option:
50
+
51
+ ```bash
52
+ plaseval-report --help
53
+ # or with uv
54
+ uv run plaseval-report --help
55
+ ```
56
+
57
+ ### Input data
58
+
59
+ The main file is a TSV file with the following base content (independent of `comp` or `eval` commands):
60
+
61
+ | Column ID | Type | Description |
62
+ | ------------- | ----- | ------------ |
63
+ | `species_id` | `str` | Species code |
64
+ | `sample_uid` | `str` | Sample UID |
65
+ | `method_code` | `str` | Method code |
66
+
67
+ The following columns are specific to `comp` command:
68
+
69
+ | Column ID | Type | Description | Measure code |
70
+ | --------------- | ------- | -------------------- | ------------ |
71
+ | `Cuts` | `float` | Normalized cut cost | `cuts` |
72
+ | `Joins` | `float` | Normalized join cost | `joins` |
73
+ | `Extra_ctgs` | `float` | Extra contigs cost | `extra` |
74
+ | `Missing_ctgs` | `float` | Missing contigs cost | `miss` |
75
+ | `Dissimilarity` | `float` | Dissimilarity | `diss` |
76
+
77
+ The following columns are specific to `eval` command:
78
+
79
+ | Column ID | Type | Description | Measure code |
80
+ | --------------- | ------- | -------------------- | ------------ |
81
+ | `unw_precision` | `float` | Unweighted precision | `unw_prec` |
82
+ | `unw_recall` | `float` | Unweighted recall | `unw_recall` |
83
+ | `unw_f1` | `float` | Unweighted F1 | `unw_f1` |
84
+ | `w_precision` | `float` | Weighted precision | `w_prec` |
85
+ | `w_recall` | `float` | Weighted recall | `w_recall` |
86
+ | `w_f1` | `float` | Weighted F1 | `w_f1` |
87
+
88
+ The configuration of the figures/stats is detailed in the `config.yaml` file (optional):
89
+
90
+ ```yaml
91
+ #
92
+ # (Optional) Method codes options
93
+ #
94
+ methods:
95
+ #
96
+ # (Optional) List of method codes to consider.
97
+ # If not set, all the method codes are considered, and the order is given by the TSV file.
98
+ # If the key to_show is not set, the method order is given by the `methods` list.
99
+ #
100
+ to_consider:
101
+ - <method_code>
102
+ - ...
103
+ #
104
+ # (Optional) List of method codes to show among the ones in `to_consider`.
105
+ # If the key to_show is set, the method order is given by the `to_show` list.
106
+ #
107
+ to_show:
108
+ - <method_code>
109
+ - ...
110
+ #
111
+ # (Optional) Map method code to labels
112
+ #
113
+ labels:
114
+ #
115
+ # One line labels.
116
+ # If not set, take the wrap labels otherwise the method codes.
117
+ #
118
+ one_line:
119
+ <method_code>: <str>
120
+ ...
121
+ #
122
+ # Labels potentially on several lines.
123
+ # If not set, take the one_line labels otherwise the method codes.
124
+ #
125
+ wrap:
126
+ <method_code>: <str>
127
+ ...
128
+ #
129
+ # (Optional) List of pairs of methods to annotate with stats
130
+ #
131
+ statannotate:
132
+ - - <method_code>
133
+ - <method_code>
134
+ - ...
135
+ #
136
+ # Method figure aesthetics
137
+ #
138
+ fig_aes:
139
+ palette: <str> # default: Set3, see https://matplotlib.org/stable/users/explain/colors/colormaps.html#qualitative
140
+ #
141
+ # Map method to palette index
142
+ # By default follow the order of the methods to show.
143
+ # If one method is missing in the map, automatically set the index to unused ones, then cycle.
144
+ #
145
+ color_indices:
146
+ <method_code>: <int> # The index of the color in the palette
147
+ ...
148
+ #
149
+ # (Optional) Species options
150
+ # It follows the same structure as for `methods`
151
+ #
152
+ species:
153
+ ...
154
+
155
+ #
156
+ # (Optional) Measures options
157
+ #
158
+ measures:
159
+ #
160
+ # (Optional) List of measures to consider.
161
+ # If not set, all the measures are considered, and the order is given by the TSV file.
162
+ #
163
+ to_consider:
164
+ - <measure_code>
165
+ - ...
166
+ #
167
+ # (Optional) List of measures to show among the ones in `to_consider`.
168
+ #
169
+ to_show:
170
+ - <measure_code>
171
+ - ...
172
+ #
173
+ # (Optional) Samples removal strategy (for the methods listed in `methods`).
174
+ # The option is valid for al but result-presence figures and stats.
175
+ #
176
+ remove_samples: fails | nothing # default: fails
177
+ #
178
+ # Figure aesthetics (Optional, everything is optional)
179
+ #
180
+ fig_aes:
181
+ context: notebook | paper | talk | poster # default: notebook
182
+ focus: true | false # default: false
183
+ ```
184
+
185
+ ### PlasEval comp/eval command results
186
+
187
+ In what follow, the same subcommands are available for both `comp` and `eval` commands.
188
+ The only difference is in the name of the measures (specific to `comp` and `eval`).
189
+ In what follow, we focus on the `comp` command.
190
+
191
+ The next section illustrates how to generate the figures.
192
+ Generating the statistics tables is following the same process.
193
+
194
+ ```bash
195
+ plaseval-report comp fig --help
196
+ ```
197
+
198
+ In the next sections, we must tell which methods we want to consider.
199
+
200
+ #### Result presence figures
201
+
202
+ Know for each tool how many samples have been evaluated by [PlasEval]:
203
+
204
+ ```bash
205
+ plaseval-report comp fig res-presence "$merge_evals_tsv" "$figs_dir/res-presence" --config "$config_yaml"
206
+ ```
207
+
208
+ #### Distribution figures
209
+
210
+ ```bash
211
+ plaseval-report comp fig distribution "$merge_evals_tsv" "$figs_dir/distribution" --config "$config_yaml"
212
+ ```
213
+
214
+ #### Versus figures
215
+
216
+ Generate a versus figure:
217
+
218
+ ```bash
219
+ x_axis="pbhmf_rfpl"
220
+ y_axis="gpcc_rfpl"
221
+
222
+ plaseval-report comp fig versus "$merge_evals_tsv" "$figs_dir/versus" "$x_axis" "$y_axis" --config "$config_yaml"
223
+ ```
224
+
225
+ > [!NOTE]
226
+ > Keys `to_show` are ignored in the versus figure.
227
+
228
+ <!-- -->
229
+
230
+ > [!TIP]
231
+ > If you are not setting the option `remove_samples` to `fails`, you can simply list the two methods of the axes in the `to_consider` key.
232
+
233
+ #### Repeat stats figures
234
+
235
+ The above figures use an additional TSV file, `repeat_stats.tsv`:
236
+
237
+ | Column ID | Description |
238
+ | -------------- | ------------ |
239
+ | `sample_uid` | Sample ID |
240
+ | `species_id` | Species ID |
241
+ | `repeat_ratio` | Repeat ratio |
242
+
243
+ An overview:
244
+
245
+ ```bash
246
+ plaseval-report fig repeat-stats overview "$repeat_stats_tsv" "$figs_dir/repeat-stats/overview" --config "$config_yaml"
247
+ ```
248
+
249
+ Evaluation measures according to the repeat ratio:
250
+
251
+ ```bash
252
+ plaseval-report fig repeat-stats eval "$merge_evals_tsv" "$repeat_stats_tsv" "$figs_dir/repeat_stats/eval" --config "$config_yaml"
253
+ ```
254
+
255
+ ### Joining the PlasEval comp and eval evaluations
256
+
257
+ In order to have the `comp` and `eval` figures on the same samples, we can join the two `TSV` files:
258
+
259
+ ```bash
260
+ plaseval-report utils join-measures --help
261
+
262
+ join_tsv=comp_eval_merge_evals.tsv
263
+ plaseval-report utils join-measures "$merge_comp_tsv" "$merge_eval_tsv" "$join_tsv"
264
+ ```
265
+
266
+ Joining the two set of measures is relevant when `remove_samples` option is set to `fails` because filtering on the joined TSV ensures all the samples have a `comp` and a `eval` evaluation.
267
+
268
+ <!-- Links -->
269
+ [PlasEval]: https://github.com/cchauve/PlasEval
270
+
271
+ <!-- Badges -->
272
+
273
+ <!--
274
+ Changes:
275
+
276
+ * PyPI project name `plaseval-report`
277
+ * Git project name `https://gitlab.com/vepain/plaseval_report-py`
278
+ * GitLab project ID `85477466`
279
+ * shields.io GitLab `vepain%2Fplaseval_report-py`
280
+ -->
281
+
282
+ [pypi_badge]: https://img.shields.io/pypi/v/plaseval-report?style=for-the-badge&logo=python&color=blue "Package badge"
283
+ [pypi_link]: https://pypi.org/project/plaseval-report/ "Package link"
284
+
285
+ [ruff_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F85477466%2Fjobs%2Fartifacts%2Fmain%2Fraw%2Fruff%2Fbadge.json%3Fjob%3Druff&style=for-the-badge&logo=ruff&label=Ruff "Ruff badge"
286
+ [ruff_link]: https://gitlab.com/vepain/plaseval_report-py/-/commits/main "Ruff link"
287
+
288
+ <!-- https://gitlab.com/api/v4/projects/85477466/jobs/artifacts/main/raw/ruff/badge.json?job=ruff -->
289
+
290
+ [ty_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fgitlab.com%2Fapi%2Fv4%2Fprojects%2F85477466%2Fjobs%2Fartifacts%2Fmain%2Fraw%2Fty%2Fbadge.json%3Fjob%3Dty&style=for-the-badge&logo=ty&label=Ty "ty badge"
291
+ [ty_link]: https://gitlab.com/vepain/plaseval_report-py/-/commits/main "ty link"
292
+
293
+ [uv_badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fastral-sh%2Fuv%2Fmain%2Fassets%2Fbadge%2Fv0.json&style=for-the-badge "uv badge"
294
+ [uv_link]: https://docs.astral.sh/uv/ "uv link"
295
+
296
+ [pipeline_badge]: https://img.shields.io/gitlab/pipeline-status/vepain%2Fplaseval_report-py?branch=main&style=for-the-badge&logo=circleci "Pipeline badge"
297
+ [pipeline_link]: https://gitlab.com/vepain/plaseval_report-py/-/commits/main "Pipeline link"
298
+
299
+ [license_badge]: https://img.shields.io/gitlab/license/vepain%2Fplaseval_report-py?style=for-the-badge&logo=readdotcv&color=green "Licence badge"
300
+ [licence_link]: https://gitlab.com/vepain/plaseval_report-py "Licence link"
@@ -0,0 +1,64 @@
1
+ [project]
2
+ name = "plaseval-report"
3
+ version = "0.1.0"
4
+ description = "Generate figures from PlasEval evaluations"
5
+ readme = "README.md"
6
+ requires-python = ">=3.13"
7
+ dependencies = [
8
+ "loguru>=0.7.3",
9
+ "matplotlib>=3.10.8",
10
+ "pandas[output-formatting]<4.0",
11
+ "pydantic>=2.13.4",
12
+ "pyyaml>=6.0.3",
13
+ "rich>=13.0,<16.0",
14
+ "seaborn<1.0",
15
+ "statannotations>=0.7.2",
16
+ "typer>=0.21.1,<1.0",
17
+ ]
18
+
19
+ [project.license]
20
+ file = "LICENSE"
21
+
22
+ [[project.authors]]
23
+ name = "vepain"
24
+ email = "victorepain@disroot.org"
25
+
26
+ [project.scripts]
27
+ plaseval-report = "plaseval_report.__main__:main"
28
+
29
+ [build-system]
30
+ requires = ["uv_build>=0.12.5,<0.13.0"]
31
+ build-backend = "uv_build"
32
+
33
+ [dependency-groups]
34
+ dev = [
35
+ { include-group = "stubs" },
36
+ "deptry>=0.24.0",
37
+ ]
38
+ stubs = [
39
+ "pandas-stubs>=3.0.0.260204",
40
+ "types-seaborn>=0.13.2.20251221",
41
+ ]
42
+
43
+ [tool.ruff.lint]
44
+ select = ["ALL"]
45
+ ignore = [
46
+ "D213",
47
+ "D203",
48
+ "TD",
49
+ "FIX",
50
+ "CPY001",
51
+ ]
52
+
53
+ [tool.ruff.lint.pydocstyle]
54
+ convention = "numpy"
55
+
56
+ [tool.ruff.lint.extend-per-file-ignores]
57
+ "tests/**/*.py" = [
58
+ "S101",
59
+ "ARG",
60
+ "FBT",
61
+ "PLR2004",
62
+ "S311",
63
+ "D103",
64
+ ]