pheval 0.5.1__py3-none-any.whl → 0.5.2__py3-none-any.whl
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.
Potentially problematic release.
This version of pheval might be problematic. Click here for more details.
- pheval/analyse/benchmark.py +37 -17
- {pheval-0.5.1.dist-info → pheval-0.5.2.dist-info}/METADATA +4 -4
- {pheval-0.5.1.dist-info → pheval-0.5.2.dist-info}/RECORD +6 -6
- {pheval-0.5.1.dist-info → pheval-0.5.2.dist-info}/LICENSE +0 -0
- {pheval-0.5.1.dist-info → pheval-0.5.2.dist-info}/WHEEL +0 -0
- {pheval-0.5.1.dist-info → pheval-0.5.2.dist-info}/entry_points.txt +0 -0
pheval/analyse/benchmark.py
CHANGED
|
@@ -23,27 +23,32 @@ def scan_directory(run: RunConfig, benchmark_type: BenchmarkOutputType) -> pl.La
|
|
|
23
23
|
run (RunConfig): RunConfig object.
|
|
24
24
|
benchmark_type (BenchmarkOutputTypeEnum): Benchmark output type.
|
|
25
25
|
Returns:
|
|
26
|
-
pl.LazyFrame: LazyFrame object containing all the results in the directory
|
|
26
|
+
pl.LazyFrame: LazyFrame object containing all the results in the directory.
|
|
27
27
|
"""
|
|
28
28
|
logger = get_logger()
|
|
29
29
|
logger.info(f"Analysing results in {run.results_dir.joinpath(benchmark_type.result_directory)}")
|
|
30
30
|
return (
|
|
31
|
-
pl.scan_parquet(
|
|
32
|
-
run.results_dir.joinpath(benchmark_type.result_directory),
|
|
33
|
-
include_file_paths="file_path",
|
|
34
|
-
).with_columns(
|
|
35
|
-
pl.col("rank").cast(pl.Int64),
|
|
36
|
-
pl.col("file_path").str.extract(r"([^/\\]+)$").alias("result_file"),
|
|
37
|
-
pl.col("true_positive").fill_null(False),
|
|
38
|
-
)
|
|
39
|
-
).filter(
|
|
40
31
|
(
|
|
41
|
-
pl.
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
pl.scan_parquet(
|
|
33
|
+
run.results_dir.joinpath(benchmark_type.result_directory),
|
|
34
|
+
include_file_paths="file_path",
|
|
35
|
+
).with_columns(
|
|
36
|
+
pl.col("rank").cast(pl.Int64),
|
|
37
|
+
pl.col("file_path").str.extract(r"([^/\\]+)$").alias("result_file"),
|
|
38
|
+
pl.col("true_positive").fill_null(False),
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
.filter(
|
|
42
|
+
(
|
|
43
|
+
pl.col("score") >= run.threshold
|
|
44
|
+
if run.score_order.lower() == "descending"
|
|
45
|
+
else pl.col("score") <= run.threshold
|
|
46
|
+
)
|
|
47
|
+
if run.threshold is not None
|
|
48
|
+
else True
|
|
44
49
|
)
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
.sort("rank")
|
|
51
|
+
.unique(subset=["file_path", *benchmark_type.columns], keep="first")
|
|
47
52
|
)
|
|
48
53
|
|
|
49
54
|
|
|
@@ -68,14 +73,29 @@ def process_stats(
|
|
|
68
73
|
)
|
|
69
74
|
curve_results.append(compute_curves(run.run_identifier, result_scan))
|
|
70
75
|
true_positive_cases.append(
|
|
71
|
-
result_scan.filter(pl.col("true_positive"))
|
|
76
|
+
result_scan.filter(pl.col("true_positive"))
|
|
77
|
+
.select(
|
|
72
78
|
["result_file", *benchmark_type.columns, pl.col("rank").alias(run.run_identifier)]
|
|
73
79
|
)
|
|
80
|
+
.sort(["result_file", *benchmark_type.columns])
|
|
74
81
|
)
|
|
75
82
|
return (
|
|
76
83
|
pl.concat(stats, how="vertical").collect(),
|
|
77
84
|
pl.concat(curve_results, how="vertical").collect(),
|
|
78
|
-
pl.concat(
|
|
85
|
+
pl.concat(
|
|
86
|
+
[true_positive_cases[0]]
|
|
87
|
+
+ [
|
|
88
|
+
df.select(
|
|
89
|
+
[
|
|
90
|
+
col
|
|
91
|
+
for col in df.collect_schema().keys()
|
|
92
|
+
if col not in ["result_file", *benchmark_type.columns]
|
|
93
|
+
]
|
|
94
|
+
)
|
|
95
|
+
for df in true_positive_cases[1:]
|
|
96
|
+
],
|
|
97
|
+
how="horizontal",
|
|
98
|
+
).collect(),
|
|
79
99
|
)
|
|
80
100
|
|
|
81
101
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pheval
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Yasemin Bridges
|
|
6
6
|
Author-email: y.bridges@qmul.ac.uk
|
|
@@ -32,10 +32,10 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
|
|
33
33
|
# PhEval - Phenotypic Inference Evaluation Framework
|
|
34
34
|
|
|
35
|
-

|
|
35
|
+
[](https://pypi.org/project/pheval/)
|
|
36
36
|

|
|
37
37
|

|
|
38
|
-

|
|
39
39
|

|
|
40
40
|
|
|
41
41
|
## Overview
|
|
@@ -53,7 +53,7 @@ For more information please see the full [documentation](https://monarch-initiat
|
|
|
53
53
|
|
|
54
54
|
## Download and Installation
|
|
55
55
|
|
|
56
|
-
1. Ensure you have Python 3.
|
|
56
|
+
1. Ensure you have Python 3.10 or greater installed.
|
|
57
57
|
2. Install with `pip`:
|
|
58
58
|
```bash
|
|
59
59
|
pip install pheval
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
pheval/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
pheval/analyse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
pheval/analyse/benchmark.py,sha256=
|
|
3
|
+
pheval/analyse/benchmark.py,sha256=sfjReLmodXwCT9ZyZDE6Oli0j1S5ygicJshb7n4-x4U,6916
|
|
4
4
|
pheval/analyse/benchmark_db_manager.py,sha256=zS1TI76YuV2_YXLipHLSyh-XDR5kTxyOwhRhHRFHfjQ,764
|
|
5
5
|
pheval/analyse/benchmark_output_type.py,sha256=bh-qQvV4AF7BHQyr_bdY8HTTzYZVe7KvoIoUF0D9k-g,1468
|
|
6
6
|
pheval/analyse/binary_classification_curves.py,sha256=Crb45rJWc5rxDdx82sgoHRvYHE2D5pus91fgl39FyRw,5007
|
|
@@ -46,8 +46,8 @@ pheval/utils/logger.py,sha256=5DZl5uMltUDQorhkvg_B7_ZhFwApAmEkWneFIOKfRGQ,1566
|
|
|
46
46
|
pheval/utils/phenopacket_utils.py,sha256=AfV_mWac6n5HCc5zjfH6CGP8T0qI0LR0VBrooaKmgdY,26978
|
|
47
47
|
pheval/utils/semsim_utils.py,sha256=s7ZCR2VfPYnOh7ApX6rv66eGoVSm9QJaVYOWBEhlXpo,6151
|
|
48
48
|
pheval/utils/utils.py,sha256=9V6vCT8l1g4O2-ZATYqsVyd7AYZdWGd-Ksy7_oIC3eE,2343
|
|
49
|
-
pheval-0.5.
|
|
50
|
-
pheval-0.5.
|
|
51
|
-
pheval-0.5.
|
|
52
|
-
pheval-0.5.
|
|
53
|
-
pheval-0.5.
|
|
49
|
+
pheval-0.5.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
50
|
+
pheval-0.5.2.dist-info/METADATA,sha256=do8ya_Tw3VD-md2rPf83DBmVTyytUrH7tEhQenjN-6o,6494
|
|
51
|
+
pheval-0.5.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
52
|
+
pheval-0.5.2.dist-info/entry_points.txt,sha256=o9gSwDkvT4-lqKy4mlsftd1nzP9WUOXQCfnbqycURd0,81
|
|
53
|
+
pheval-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|