pheval-exomiser 0.4.5__py3-none-any.whl → 0.4.8__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.
- pheval_exomiser/post_process/post_process_results_format.py +47 -6
- {pheval_exomiser-0.4.5.dist-info → pheval_exomiser-0.4.8.dist-info}/METADATA +2 -2
- {pheval_exomiser-0.4.5.dist-info → pheval_exomiser-0.4.8.dist-info}/RECORD +5 -5
- {pheval_exomiser-0.4.5.dist-info → pheval_exomiser-0.4.8.dist-info}/WHEEL +0 -0
- {pheval_exomiser-0.4.5.dist-info → pheval_exomiser-0.4.8.dist-info}/entry_points.txt +0 -0
|
@@ -13,6 +13,19 @@ from pheval.post_processing.post_processing import (
|
|
|
13
13
|
)
|
|
14
14
|
from pheval.utils.file_utils import files_with_suffix
|
|
15
15
|
|
|
16
|
+
EXOMISER_LT_15 = {"combinedScore", "priorityScore", "variantScore", "pValue"}
|
|
17
|
+
EXOMISER_GTE_15 = {"geneCombinedScore", "geneVariantScore", "pValue"}
|
|
18
|
+
|
|
19
|
+
ALL_SCORE_NAMES = sorted(EXOMISER_LT_15 | EXOMISER_GTE_15)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _allowed_score_names(exomiser_version: str) -> set[str]:
|
|
23
|
+
return (
|
|
24
|
+
EXOMISER_GTE_15
|
|
25
|
+
if version.parse(exomiser_version) >= version.parse("15.0.0")
|
|
26
|
+
else EXOMISER_LT_15
|
|
27
|
+
)
|
|
28
|
+
|
|
16
29
|
|
|
17
30
|
class ModeOfInheritance(Enum):
|
|
18
31
|
AUTOSOMAL_DOMINANT = 1
|
|
@@ -27,6 +40,28 @@ class ModeOfInheritance(Enum):
|
|
|
27
40
|
MT = 3
|
|
28
41
|
|
|
29
42
|
|
|
43
|
+
def check_score_name(score_name: str, version: str):
|
|
44
|
+
"""
|
|
45
|
+
Validates the provided score name for compatibility with the specified Exomiser version.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
score_name: str
|
|
49
|
+
The name of the score to validate.
|
|
50
|
+
version: str
|
|
51
|
+
The Exomiser version for which the validation is performed.
|
|
52
|
+
Raises:
|
|
53
|
+
click.BadParameter: Raised if the provided score name is not valid,
|
|
54
|
+
including the list of allowed score names in the error message.
|
|
55
|
+
"""
|
|
56
|
+
allowed_score_names = _allowed_score_names(version)
|
|
57
|
+
if score_name not in allowed_score_names:
|
|
58
|
+
raise click.BadParameter(
|
|
59
|
+
f"'{score_name}' is not valid for Exomiser {version}. "
|
|
60
|
+
f"Allowed values: {', '.join(sorted(allowed_score_names))}.",
|
|
61
|
+
param_hint="--score-name",
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
30
65
|
def trim_exomiser_result_filename(exomiser_result_path: Path) -> Path:
|
|
31
66
|
"""Trim suffix appended to Exomiser JSON result path."""
|
|
32
67
|
return Path(str(exomiser_result_path.name).replace("-exomiser", ""))
|
|
@@ -46,14 +81,21 @@ def extract_gene_results_from_json(
|
|
|
46
81
|
|
|
47
82
|
|
|
48
83
|
def extract_gene_results_from_parquet(
|
|
49
|
-
exomiser_parquet_result: pl.DataFrame, score_name: str
|
|
84
|
+
exomiser_parquet_result: pl.DataFrame, score_name: str, variant_analysis: bool
|
|
50
85
|
) -> pl.DataFrame:
|
|
86
|
+
if variant_analysis:
|
|
87
|
+
exomiser_parquet_result = exomiser_parquet_result.filter(
|
|
88
|
+
pl.col("isContributingVariant") == True # noqa
|
|
89
|
+
)
|
|
51
90
|
return exomiser_parquet_result.select(
|
|
52
91
|
[
|
|
53
92
|
pl.col("geneSymbol").alias("gene_symbol"),
|
|
54
93
|
pl.col("ensemblGeneId").alias("gene_identifier"),
|
|
55
94
|
pl.col(score_name).fill_null(0).round(4).alias("score"),
|
|
56
95
|
]
|
|
96
|
+
).unique(
|
|
97
|
+
subset=["gene_symbol", "gene_identifier"],
|
|
98
|
+
keep="first",
|
|
57
99
|
)
|
|
58
100
|
|
|
59
101
|
|
|
@@ -241,7 +283,7 @@ def create_standardised_results(
|
|
|
241
283
|
exomiser_result = pl.read_json(exomiser_result_path, infer_schema_length=None)
|
|
242
284
|
if gene_analysis:
|
|
243
285
|
gene_results = (
|
|
244
|
-
extract_gene_results_from_parquet(exomiser_result, score_name)
|
|
286
|
+
extract_gene_results_from_parquet(exomiser_result, score_name, variant_analysis)
|
|
245
287
|
if use_parquet
|
|
246
288
|
else extract_gene_results_from_json(exomiser_result, score_name)
|
|
247
289
|
)
|
|
@@ -308,11 +350,9 @@ def create_standardised_results(
|
|
|
308
350
|
@click.option(
|
|
309
351
|
"--score-name",
|
|
310
352
|
"-s",
|
|
353
|
+
type=click.Choice(ALL_SCORE_NAMES),
|
|
354
|
+
help="Score column to extract (valid values depend on Exomiser version).",
|
|
311
355
|
required=True,
|
|
312
|
-
help="Score name to extract from results.",
|
|
313
|
-
type=click.Choice(["combinedScore", "priorityScore", "variantScore", "pValue"]),
|
|
314
|
-
default="combinedScore",
|
|
315
|
-
show_default=True,
|
|
316
356
|
)
|
|
317
357
|
@click.option(
|
|
318
358
|
"--sort-order",
|
|
@@ -376,6 +416,7 @@ def post_process_exomiser_results(
|
|
|
376
416
|
if disease_analysis
|
|
377
417
|
else None
|
|
378
418
|
)
|
|
419
|
+
check_score_name(score_name, version)
|
|
379
420
|
create_standardised_results(
|
|
380
421
|
result_dir=results_dir,
|
|
381
422
|
output_dir=output_dir,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pheval_exomiser
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Yasemin Bridges
|
|
6
6
|
Author-email: y.bridges@qmul.ac.uk
|
|
@@ -17,7 +17,7 @@ Requires-Dist: google (>=3.0.0,<4.0.0)
|
|
|
17
17
|
Requires-Dist: numpy (<2)
|
|
18
18
|
Requires-Dist: oaklib (>=0.5.12,<0.6.0)
|
|
19
19
|
Requires-Dist: phenopackets (>=2.0.2,<3.0.0)
|
|
20
|
-
Requires-Dist: pheval (>=0.
|
|
20
|
+
Requires-Dist: pheval (>=0.7.0,<0.8.0)
|
|
21
21
|
Requires-Dist: pyaml (>=21.10.1,<22.0.0)
|
|
22
22
|
Requires-Dist: pydantic (>=2.7.1,<3.0.0)
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -3,7 +3,7 @@ pheval_exomiser/cli.py,sha256=0SR1-L2sREEkFRfUPwYwkbSaBsz_L_Sxq1S4c9LQLJg,350
|
|
|
3
3
|
pheval_exomiser/constants.py,sha256=o_pLWF8kX74BqyTsAZa7twwSKzedLnpupCI90k_bMqY,517
|
|
4
4
|
pheval_exomiser/post_process/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
pheval_exomiser/post_process/post_process.py,sha256=bGNLO0LlsG26oKtvL3mtlcBTDY5gynKh1BwNjmUaIgI,972
|
|
6
|
-
pheval_exomiser/post_process/post_process_results_format.py,sha256=
|
|
6
|
+
pheval_exomiser/post_process/post_process_results_format.py,sha256=vx3slcwdUH9ZJXqA7ty8W3ITPa4AraFKeDvCpwZwdsM,13955
|
|
7
7
|
pheval_exomiser/prepare/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
pheval_exomiser/prepare/create_batch_commands.py,sha256=G-2pRboJalW8MeXDwSHR1ZAuhNdQJdHjJPxOo0KBgPM,18930
|
|
9
9
|
pheval_exomiser/prepare/tool_specific_configuration_options.py,sha256=pFzieoZogiPhSquN2p7THcXuCBrzqANwqbWO0e6BPu4,2943
|
|
@@ -11,7 +11,7 @@ pheval_exomiser/prepare/write_application_properties.py,sha256=KmG7GvkQo8AhnhRyq
|
|
|
11
11
|
pheval_exomiser/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
pheval_exomiser/run/run.py,sha256=n9cDv9E4d-NELCIY_v2UCrXqbWOo27TM2_9lPn-YOwI,8030
|
|
13
13
|
pheval_exomiser/runner.py,sha256=RqVobVJlOwcPzbO5gLjDtkGaygWdFT9VrlIvOmyBQPw,2706
|
|
14
|
-
pheval_exomiser-0.4.
|
|
15
|
-
pheval_exomiser-0.4.
|
|
16
|
-
pheval_exomiser-0.4.
|
|
17
|
-
pheval_exomiser-0.4.
|
|
14
|
+
pheval_exomiser-0.4.8.dist-info/METADATA,sha256=yCuPPL8ftxtpnpM27VqlfXI-NDbTuLZpexAATtPjmy0,7294
|
|
15
|
+
pheval_exomiser-0.4.8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
16
|
+
pheval_exomiser-0.4.8.dist-info/entry_points.txt,sha256=lbZMu-x7ns8UrFveWSqEQ1UB5l33TbRMomqBUyGYIwI,131
|
|
17
|
+
pheval_exomiser-0.4.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|